Skip to content

Commit

Permalink
chore: use translations for calendar days (usememos#3895)
Browse files Browse the repository at this point in the history
Use translations for calendar days
  • Loading branch information
RoccoSmit authored Sep 8, 2024
1 parent 044d46c commit 05d5fb4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions web/src/components/ActivityCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = [];
Expand Down

0 comments on commit 05d5fb4

Please sign in to comment.