|
|
@@ -128,7 +128,7 @@ import { extractTime } from "@/utils/format";
|
|
|
useAuthGuard();
|
|
|
|
|
|
const currentUser = useCurrentUser();
|
|
|
-const weeks = ["日", "一", "二", "三", "四", "五", "六"];
|
|
|
+const weeks = ["一", "二", "三", "四", "五", "六", "日"];
|
|
|
|
|
|
const currentMonth = ref(formatMonth(new Date()));
|
|
|
const monthList = ref([]); // ESS 月度返回数组
|
|
|
@@ -173,7 +173,10 @@ const summary = computed(() => {
|
|
|
|
|
|
const grid = computed(() => {
|
|
|
const [y, m] = currentMonth.value.split("-").map(Number);
|
|
|
- const firstDay = new Date(y, m - 1, 1).getDay();
|
|
|
+ // 周一作为一周的起始:JS getDay() 周日=0、周一=1...周六=6,
|
|
|
+ // 转成周一=0、周日=6 的偏移,便于和上面 weeks 数组对位
|
|
|
+ const jsDay = new Date(y, m - 1, 1).getDay();
|
|
|
+ const firstDay = (jsDay + 6) % 7;
|
|
|
const totalDays = new Date(y, m, 0).getDate();
|
|
|
const todayStr = formatDate(new Date());
|
|
|
const byDate = new Map();
|