From 49ba98028491697a727d6f4ad17c76ef26b81f25 Mon Sep 17 00:00:00 2001 From: Kanbuduo <544852152@qq.com> Date: Thu, 6 Jul 2023 16:27:06 +0800 Subject: [PATCH] Update WeekTimeline.vue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: When { locale: ‘zh-CN’ }, the weekly mode is displayed abnormally --- src/components/week/WeekTimeline.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/week/WeekTimeline.vue b/src/components/week/WeekTimeline.vue index 3b351039..c39de73b 100644 --- a/src/components/week/WeekTimeline.vue +++ b/src/components/week/WeekTimeline.vue @@ -11,7 +11,7 @@ @click="$emit('day-was-clicked', time.dateStringFrom(day.dateTimeString))" >
- {{ day.dayName.substring(0, 2).toUpperCase() }} + {{ getWeekTimeStr(day) }}
@@ -89,6 +89,10 @@ export default defineComponent({ return date; }, + getWeekTimeStr(day: dayInterface) { + const isCN = this.config?.locale?.toLowerCase() === 'zh-cn'; + return isCN ? day.dayName : day.dayName.substring(0, 2).toUpperCase(); + } }, });