[#154] added timezone component to change timezone of calendar (#207)

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
Camille Moussu
2025-10-14 15:25:28 +02:00
committed by GitHub
parent 26e69091d9
commit 770257c03b
14 changed files with 712 additions and 137 deletions
+10
View File
@@ -380,6 +380,12 @@ const CalendarSlice = createSlice({
list: {} as Record<string, Calendars>,
templist: {} as Record<string, Calendars>,
pending: false,
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
} as {
list: Record<string, Calendars>;
templist: Record<string, Calendars>;
pending: boolean;
timeZone: string;
},
reducers: {
createCalendar: (state, action: PayloadAction<Record<string, string>>) => {
@@ -423,6 +429,9 @@ const CalendarSlice = createSlice({
const { calId, event } = action.payload;
state.list[calId].events[event.uid] = event;
},
setTimeZone: (state, action: PayloadAction<string>) => {
state.timeZone = action.payload;
},
},
extraReducers: (builder) => {
builder
@@ -689,5 +698,6 @@ export const {
createCalendar,
updateEventLocal,
removeTempCal,
setTimeZone,
} = CalendarSlice.actions;
export default CalendarSlice.reducer;