From 9dbd6d21e123ede6973cd55a2255f1f835d5651a Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 20 Mar 2017 17:11:11 +0100 Subject: [PATCH] [FIX] web_calendar: timezone on event display regression In fb05d884 event that were not displayed for arabic were fixed but there could be an error when displaying timezone caused by this change. As said in https://fullcalendar.io/docs1/event_data/ignoreTimezone/ the ignoreTimezone parameter is set to `true` by default in FullCalendar 1 (this is not the case in current FullCalendar). So there is two way to solves this time zone issue: - keep fb05d884 and have the parameter ignoreTimezone set to `false` - use momentjs `.toString()` to get a javascript english date string which will thereafter be parsed by javascript `new Date()`. This commit use the second way since it is nearer what was originaly and hopefully safer. opw-705752 momentjs doc on toString: http://momentjs.com/docs/#/displaying/as-string/ --- addons/web_calendar/static/src/js/web_calendar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web_calendar/static/src/js/web_calendar.js b/addons/web_calendar/static/src/js/web_calendar.js index 89d125c48af..4f83cd02b50 100644 --- a/addons/web_calendar/static/src/js/web_calendar.js +++ b/addons/web_calendar/static/src/js/web_calendar.js @@ -639,8 +639,8 @@ var CalendarView = View.extend({ date_stop = m_start.toDate(); } var r = { - 'start': moment(date_start).toISOString(), - 'end': moment(date_stop).toISOString(), + 'start': moment(date_start).toString(), + 'end': moment(date_stop).toString(), 'title': the_title, 'allDay': (this.fields[this.date_start].type == 'date' || (this.all_day && evt[this.all_day]) || false), 'id': evt.id,