Issue #1511 : Use the user account timezone setting by default for the timezone of the event

This commit is contained in:
Massedil 2024-11-01 19:17:05 +01:00
parent b440e129a9
commit c0e906023c

View file

@ -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