From bb89a0a6111a9c98d54411d41ec2e63575eea53f Mon Sep 17 00:00:00 2001 From: longyvfengyun <496960745@qq.com> Date: 星期二, 02 一月 2024 15:01:02 +0800 Subject: [PATCH] 内容修改 --- src/main.js | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/src/main.js b/src/main.js index fd6e8e2..7f24754 100644 --- a/src/main.js +++ b/src/main.js @@ -31,6 +31,27 @@ bootstrap({router, store, i18n, message: Vue.prototype.$message}) +//鏍煎紡鍖栨椂闂� +Date.prototype.format = function (format) { + var o = { + "M+": this.getMonth() + 1, //month + "d+": this.getDate(), //day + "h+": this.getHours(), //hour + "m+": this.getMinutes(), //minute + "s+": this.getSeconds(), //second + "q+": Math.floor((this.getMonth() + 3) / 3), //quarter + "S": this.getMilliseconds() //millisecond + }; + if (/(y+)/.test(format)) format = format.replace(RegExp.$1, + (this.getFullYear() + "").substr(4 - RegExp.$1.length)); + for (var k in o) + if (new RegExp("(" + k + ")").test(format)) + format = format.replace(RegExp.$1, + RegExp.$1.length == 1 ? o[k] : + ("00" + o[k]).substr(("" + o[k]).length)); + return format; +}; + new Vue({ router, store, -- Gitblit v1.9.1