merge-upstream-5.0.1 #66

Merged
778a69cd merged 80 commits from merge-upstream-5.0.1 into main 2024-12-26 12:55:41 +01:00
Showing only changes of commit b440e129a9 - Show all commits

View file

@ -718,9 +718,11 @@ const saving = ref(false);
const initializeEvent = () => { const initializeEvent = () => {
const roundUpTo15Minutes = (time: Date) => { const roundUpTo15Minutes = (time: Date) => {
time.setMilliseconds(Math.round(time.getMilliseconds() / 1000) * 1000); time.setUTCMilliseconds(
time.setSeconds(Math.round(time.getSeconds() / 60) * 60); Math.round(time.getUTCMilliseconds() / 1000) * 1000
time.setMinutes(Math.round(time.getMinutes() / 15) * 15); );
time.setUTCSeconds(Math.round(time.getUTCSeconds() / 60) * 60);
time.setUTCMinutes(Math.round(time.getUTCMinutes() / 15) * 15);
return time; return time;
}; };
@ -1208,7 +1210,7 @@ const beginsOn = computed({
} }
// return event.value.beginsOn taking care of timezone // return event.value.beginsOn taking care of timezone
const date = new Date(event.value.beginsOn); const date = new Date(event.value.beginsOn);
date.setMinutes(date.getMinutes() + tzOffset(date)); date.setUTCMinutes(date.getUTCMinutes() + tzOffset(date));
return date; return date;
}, },
set(newBeginsOn: Date | null) { set(newBeginsOn: Date | null) {
@ -1218,18 +1220,18 @@ const beginsOn = computed({
} }
// usefull for comparaison // usefull for comparaison
newBeginsOn.setSeconds(0); newBeginsOn.setUTCSeconds(0);
newBeginsOn.setMilliseconds(0); newBeginsOn.setUTCMilliseconds(0);
// update event.value.beginsOn taking care of timezone // update event.value.beginsOn taking care of timezone
const date = new Date(newBeginsOn.getTime()); const date = new Date(newBeginsOn.getTime());
date.setMinutes(date.getMinutes() - tzOffset(newBeginsOn)); date.setUTCMinutes(date.getUTCMinutes() - tzOffset(newBeginsOn));
event.value.beginsOn = date.toISOString(); event.value.beginsOn = date.toISOString();
// Update endsOn to make sure endsOn is later than beginsOn // Update endsOn to make sure endsOn is later than beginsOn
if (endsOn.value && endsOn.value <= newBeginsOn) { if (endsOn.value && endsOn.value <= newBeginsOn) {
const newEndsOn = new Date(newBeginsOn); const newEndsOn = new Date(newBeginsOn);
newEndsOn.setHours(newBeginsOn.getHours() + 1); newEndsOn.setUTCHours(newBeginsOn.getUTCHours() + 1);
endsOn.value = newEndsOn; endsOn.value = newEndsOn;
} }
}, },
@ -1243,7 +1245,7 @@ const endsOn = computed({
// return event.value.endsOn taking care of timezone // return event.value.endsOn taking care of timezone
const date = new Date(event.value.endsOn); const date = new Date(event.value.endsOn);
date.setMinutes(date.getMinutes() + tzOffset(date)); date.setUTCMinutes(date.getUTCMinutes() + tzOffset(date));
return date; return date;
}, },
set(newEndsOn: Date | null) { set(newEndsOn: Date | null) {
@ -1253,12 +1255,12 @@ const endsOn = computed({
} }
// usefull for comparaison // usefull for comparaison
newEndsOn.setSeconds(0); newEndsOn.setUTCSeconds(0);
newEndsOn.setMilliseconds(0); newEndsOn.setUTCMilliseconds(0);
// update event.value.endsOn taking care of timezone // update event.value.endsOn taking care of timezone
const date = new Date(newEndsOn.getTime()); const date = new Date(newEndsOn.getTime());
date.setMinutes(date.getMinutes() - tzOffset(newEndsOn)); date.setUTCMinutes(date.getUTCMinutes() - tzOffset(newEndsOn));
event.value.endsOn = date.toISOString(); event.value.endsOn = date.toISOString();
}, },
}); });