|
@@ -1,3 +1,5 @@
|
|
|
+import moment from "moment";
|
|
|
+
|
|
|
//根据value值回显字典label值
|
|
|
export function dictDataEcho(value, arr) {
|
|
|
if (value && arr) {
|
|
@@ -37,3 +39,11 @@ export function moneyFormat(s, n) {
|
|
|
return "0.00";
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// 计算该日期是星期几
|
|
|
+export function calculationWeek(val, format) {
|
|
|
+ let weekArrayList = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
|
|
|
+ let index = new Date(moment(val, format).format("yyyy-MM-DD")).getDay();
|
|
|
+ let week = weekArrayList[index];
|
|
|
+ return week;
|
|
|
+}
|