We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9212a4a commit f064747Copy full SHA for f064747
src/components/Calendar/index.jsx
@@ -9,7 +9,11 @@ export default function Calendar() {
9
useEffect(() => {
10
if (Intl) {
11
const locale = Intl.DateTimeFormat().resolvedOptions().locale;
12
- setFirstDay((new Intl.Locale(locale)?.weekInfo?.firstDay ?? 0) + 1);
+ // firstDay API returns 1 for Monday and 7 for Sunday
13
+ // Google Calendar expects 1 for Sunday and 6 for Saturday
14
+ let day = (new Intl.Locale(locale)?.weekInfo?.firstDay ?? 0) + 1;
15
+ if (day === 8) day = 1; // Sunday
16
+ setFirstDay(day);
17
setTimezone(Intl.DateTimeFormat().resolvedOptions().timeZone);
18
}
19
setThemeMode(colorMode);
0 commit comments