From 05d5fb4b047aafe471c129f1f72ba80ddf4dfcf3 Mon Sep 17 00:00:00 2001 From: RoccoSmit Date: Sun, 8 Sep 2024 22:24:59 +1000 Subject: [PATCH] chore: use translations for calendar days (#3895) Use translations for calendar days --- web/src/components/ActivityCalendar.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/src/components/ActivityCalendar.tsx b/web/src/components/ActivityCalendar.tsx index e2cf67c7..9aaf3ad0 100644 --- a/web/src/components/ActivityCalendar.tsx +++ b/web/src/components/ActivityCalendar.tsx @@ -6,8 +6,6 @@ import { WorkspaceGeneralSetting } from "@/types/proto/api/v1/workspace_setting_ import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting"; import { useTranslate } from "@/utils/i18n"; -const WEEK_DAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]; - interface Props { // Format: 2021-1 month: string; @@ -43,6 +41,7 @@ const ActivityCalendar = (props: Props) => { const dayInMonth = new Date(year, month, 0).getDate(); const firstDay = (new Date(year, month - 1, 1).getDay() - weekStartDayOffset) % 7; const lastDay = new Date(year, month - 1, dayInMonth).getDay() - weekStartDayOffset; + const WEEK_DAYS = [t("days.sun"), t("days.mon"), t("days.tue"), t("days.wed"), t("days.thu"), t("days.fri"), t("days.sat")]; const weekDays = WEEK_DAYS.slice(weekStartDayOffset).concat(WEEK_DAYS.slice(0, weekStartDayOffset)); const maxCount = Math.max(...Object.values(data)); const days = [];