mirror of https://github.com/OCA/web.git
[FIX] web_calendar_slot_duration: finish migration
parent
084c67a07a
commit
2d8b02f9a8
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 15.0\n"
|
"Project-Id-Version: Odoo Server 16.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
|
|
|
@ -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