[FIX] web_calendar_slot_duration: finish migration

pull/2786/head
David 2023-10-31 17:52:06 +01:00 committed by Christopher Rogos
parent b35f3326ea
commit 4ea6b638d0
1 changed files with 4 additions and 2 deletions

View File

@ -10,10 +10,12 @@ patch(CalendarModel.prototype, "WebCalendarSlotDurationCalendarModel", {
buildRawRecord(partialRecord, options = {}) {
if (
this.env.searchModel.context.calendar_slot_duration &&
partialRecord.isAllDay != true
!partialRecord.isAllDay
) {
const slot_duration = this.env.searchModel.context.calendar_slot_duration;
const [hours, minutes, seconds] = slot_duration.match(/(\d+):(\d+):(\d+)/);
const [hours, minutes, seconds] = slot_duration
.match(/(\d+):(\d+):(\d+)/)
.slice(1, 4);
const durationFloat = hours + minutes / 60 + seconds / 3600;
partialRecord.end = partialRecord.start.plus({hours: durationFloat});
}