瀏覽代碼

修改页面显示时间

xusonglin 4 年之前
父節點
當前提交
bdbbed10be
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      tianti-modules/tianti-module-gateway/src/main/webapp/static/js/common.js

+ 3 - 2
tianti-modules/tianti-module-gateway/src/main/webapp/static/js/common.js

@@ -371,6 +371,7 @@
         formatDate: function (timestamp, format) {
             var newDate = new Date(timestamp);
             var date = {
+                "Y+": newDate.getUTCFullYear(),
                 "M+": newDate.getMonth() + 1,
                 "d+": newDate.getDate(),
                 "h+": newDate.getHours(),
@@ -381,7 +382,7 @@
             };
 
             if (!format) {
-                format = "M月dd日";
+                format = "YYYY年M月dd日";
             }
 
             if (/(y+)/i.test(format)) {
@@ -804,4 +805,4 @@
 
     window.jc = jc;
 
-})(window);
+})(window);