Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Fix wrong timezone shown in preferences

Luke Vella797f5505b1b9
diff --git a/apps/web/src/app/[locale]/(app)/(space)/settings/preferences/components/date-time-preferences.tsx b/apps/web/src/app/[locale]/(app)/(space)/settings/preferences/components/date-time-preferences.tsx
index ac2678641..4fb1989c7 100644
--- a/apps/web/src/app/[locale]/(app)/(space)/settings/preferences/components/date-time-preferences.tsx
+++ b/apps/web/src/app/[locale]/(app)/(space)/settings/preferences/components/date-time-preferences.tsx
@@ -21,6 +21,7 @@ import { TimeZoneSelect } from "@/components/time-zone-picker/time-zone-select";
import { usePreferences } from "@/contexts/preferences";
import { Trans } from "@/i18n/client";
import { dayjs } from "@/lib/dayjs";
+import { useTimezone } from "@/lib/timezone/client/context";
import { useDayjs } from "@/utils/dayjs";
const formSchema = z.object({
@@ -30,7 +31,8 @@ const formSchema = z.object({
});
export const DateTimePreferences = () => {
- const { timeFormat, weekStart, timeZone } = useDayjs();
+ const { timezone } = useTimezone();
+ const { timeFormat, weekStart } = useDayjs();
const { updatePreferences } = usePreferences();
const form = useForm({
@@ -38,7 +40,7 @@ export const DateTimePreferences = () => {
defaultValues: {
timeFormat,
weekStart,
- timeZone,
+ timeZone: timezone,
},
});