mirror of https://github.com/OCA/web.git
[FIX] web_calendar_slot_duration: finish migration
parent
b35f3326ea
commit
4ea6b638d0
|
@ -10,10 +10,12 @@ patch(CalendarModel.prototype, "WebCalendarSlotDurationCalendarModel", {
|
||||||
buildRawRecord(partialRecord, options = {}) {
|
buildRawRecord(partialRecord, options = {}) {
|
||||||
if (
|
if (
|
||||||
this.env.searchModel.context.calendar_slot_duration &&
|
this.env.searchModel.context.calendar_slot_duration &&
|
||||||
partialRecord.isAllDay != true
|
!partialRecord.isAllDay
|
||||||
) {
|
) {
|
||||||
const slot_duration = this.env.searchModel.context.calendar_slot_duration;
|
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;
|
const durationFloat = hours + minutes / 60 + seconds / 3600;
|
||||||
partialRecord.end = partialRecord.start.plus({hours: durationFloat});
|
partialRecord.end = partialRecord.start.plus({hours: durationFloat});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue