fix: set timezone changes as repetition rule changes for recurring events
This commit is contained in:
committed by
Benoit TELLIER
parent
16317356fb
commit
a31825ce3a
@@ -495,22 +495,20 @@ function EventUpdateModal({
|
|||||||
const oldRepetition = normalizeRepetition(event.repetition);
|
const oldRepetition = normalizeRepetition(event.repetition);
|
||||||
const newRepetition = normalizeRepetition(repetition);
|
const newRepetition = normalizeRepetition(repetition);
|
||||||
|
|
||||||
console.log("[DEBUG] Repetition comparison:", {
|
// Normalize timezone for comparison (undefined, null, "" → null, resolve aliases)
|
||||||
old: oldRepetition,
|
const normalizeTimezone = (tz: string | undefined | null) => {
|
||||||
new: newRepetition,
|
if (!tz) return null;
|
||||||
oldRaw: event.repetition,
|
// Resolve timezone aliases (e.g., Asia/Saigon → Asia/Ho_Chi_Minh)
|
||||||
newRaw: repetition,
|
return resolveTimezone(tz);
|
||||||
});
|
};
|
||||||
|
|
||||||
|
const oldTimezone = normalizeTimezone(event.timezone);
|
||||||
|
const newTimezone = normalizeTimezone(timezone);
|
||||||
|
const timezoneChanged = oldTimezone !== newTimezone;
|
||||||
|
|
||||||
const repetitionRulesChanged =
|
const repetitionRulesChanged =
|
||||||
JSON.stringify(oldRepetition) !== JSON.stringify(newRepetition);
|
JSON.stringify(oldRepetition) !== JSON.stringify(newRepetition) ||
|
||||||
|
timezoneChanged;
|
||||||
console.log("[DEBUG] repetitionRulesChanged =", repetitionRulesChanged);
|
|
||||||
console.log(
|
|
||||||
repetitionRulesChanged
|
|
||||||
? "[RELOAD] Repetition rules changed"
|
|
||||||
: "[OPTIMISTIC] Properties only"
|
|
||||||
);
|
|
||||||
|
|
||||||
if (repetitionRulesChanged) {
|
if (repetitionRulesChanged) {
|
||||||
// Repetition rules changed - need server to recalculate instances
|
// Repetition rules changed - need server to recalculate instances
|
||||||
|
|||||||
Reference in New Issue
Block a user