Browse Source

修改页面显示时间

xusonglin 4 years ago
parent
commit
bdbbed10be

+ 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);