Просмотр исходного кода

修改制单日期为默认近一个月

caojunjie 3 лет назад
Родитель
Сommit
952b4576eb
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/util/date.js

+ 2 - 2
src/util/date.js

@@ -67,8 +67,8 @@ export function defaultDate(type) {
     ];
   }else if (type == 3){
     return[
-      dateFormat(new Date(date.getFullYear(), date.getMonth(), 1), "yyyy-MM-dd"),
-      dateFormat(new Date((date.getMonth() + 1) === 12?date.getFullYear()+1:date.getFullYear(), (date.getMonth() + 1), 1), "yyyy-MM-dd")
+      dateFormat(new Date(date.getFullYear(), date.getMonth(), date.getDate()), "yyyy-MM-dd"),
+      dateFormat(new Date((date.getMonth() + 1) === 12?date.getFullYear()+1:date.getFullYear(), (date.getMonth() + 1), date.getDate()), "yyyy-MM-dd")
     ];
   }else {
     return [