From c0e906023cb3e0cbc8da462319dcde3ecb07ea32 Mon Sep 17 00:00:00 2001 From: Massedil Date: Fri, 1 Nov 2024 19:17:05 +0100 Subject: [PATCH] Issue #1511 : Use the user account timezone setting by default for the timezone of the event --- src/views/Event/EditView.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/views/Event/EditView.vue b/src/views/Event/EditView.vue index a072d13a3..751deafff 100644 --- a/src/views/Event/EditView.vue +++ b/src/views/Event/EditView.vue @@ -716,7 +716,19 @@ const dateSettingsIsOpen = ref(false); const saving = ref(false); +const setEventTimezoneToUserTimezoneIfUnset = () => { + if (userTimezone.value && event.value.options.timezone == null) { + event.value.options.timezone = userTimezone.value; + } +}; + +// usefull if the page is loaded from scratch +watch(loggedUser, setEventTimezoneToUserTimezoneIfUnset); + const initializeEvent = () => { + // usefull if the data is already cached + setEventTimezoneToUserTimezoneIfUnset(); + const roundUpTo15Minutes = (time: Date) => { time.setUTCMilliseconds( Math.round(time.getUTCMilliseconds() / 1000) * 1000