From c1f354beb881a47fb8d54f21034850ee16d4cdb9 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 17 Apr 2019 15:56:20 +0000 Subject: [FIX] web: date field in calendar no tz issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The calendar should send to server: - for an all day event (all_day field on view): the date in UTC (ie. if we are on 22 august 2018 on UTC+2, not send 21 august 2018 22:00) - for a datetime event not all day: the UTC datetime corresponding to UTC (for 03:25 with UTC+5 timezone, we send 22:25 the day before) - for a date event: the date in UTC (ie. same as all day) The current code was alright for datetime, but there was a missing case if the start_date was a Date field (eg. project task calendar view uses a date_deadline Date field) and not a Datetime field. This changeset apply the same behavior as an all_day event to a calendar with a start date that is a Date field. Note: the issue happen since 11.0's 03d74f4 (26th march 2019) that solved a similar case but for datetime (a datetime event at 8:00 with timezone UTC+9 would be moved the previous day when drag and dropped on the month view). opw-1969876 opw-1971106 opw-1971019 closes #32796 Signed-off-by: Adrien Dieudonné (adr) --- addons/web/static/src/js/views/calendar/calendar_model.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views/calendar/calendar_model.js b/addons/web/static/src/js/views/calendar/calendar_model.js index 057737d674f..0c12735673e 100644 --- a/addons/web/static/src/js/views/calendar/calendar_model.js +++ b/addons/web/static/src/js/views/calendar/calendar_model.js @@ -58,10 +58,11 @@ return AbstractModel.extend({ end.add(-1, 'days'); } + var isDateEvent = this.fields[this.mapping.date_start].type === 'date'; // An "allDay" event without the "all_day" option is not considered // as a 24h day. It's just a part of the day (by default: 7h-19h). if (event.allDay) { - if (!this.mapping.all_day) { + if (!this.mapping.all_day && !isDateEvent) { if (event.r_start) { start.hours(event.r_start.hours()) .minutes(event.r_start.minutes()) -- cgit v1.2.3 From b09d20ab29a13e1b6c851b67beb81bcf0dbd7d42 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 15 Jan 2019 16:03:02 +0000 Subject: [FIX] web: no ResizeObserver video error on chrome When displaying a video, with the browser window at a certain size, or resizing it (or opening developer tools) we could the following error: "ResizeObserver loop limit exceeded" This can be reproduced in chromium just with this JS code: window.onerror = function(e){ console.log(e); }; document.body.innerHTML = '