chore: use translations for calendar days (#3895)

Use translations for calendar days
This commit is contained in:
RoccoSmit 2024-09-08 22:24:59 +10:00 committed by GitHub
parent 044d46c36d
commit 05d5fb4b04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 = [];