Explorar o código

添加得到礼拜几的方法

xiaohaizhao hai 1 ano
pai
achega
8d74ef9e13
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      utils/getTime.js

+ 1 - 2
utils/getTime.js

@@ -13,8 +13,7 @@ const formatNumber = n => {
 }
 
 function getWeek(deta = new Date(), prefix = '周') {
-    weeks = new Array("日", "一", "二", "三", "四", "五", "六");
-    return prefix + weeks[deta.getDay()];
+    return prefix + ["日", "一", "二", "三", "四", "五", "六"][deta.getDay()];
 }
 
 function getYMD(date = new Date()) {