summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2017-03-16 16:07:29 +0100
committerNicolas Lempereur <nle@odoo.com>2017-03-16 22:07:29 +0100
commitfb05d8845d92b1ca9013307664fa6d52be64aa3d (patch)
treeae10220f8b12bd860d07f4796d87afe30ff83e11
parentf50ba68be72c8b63af87e8dcd0e726e5e3b77092 (diff)
[FIX] web_calendar: events not appearing in arabic
Fullcalendar expect as `start` and `end` property of an event object: > When specifying Event Objects for events or eventSources, you may > specify a string in IETF format (ex: "Wed, 18 Oct 2009 13:00:00 EST"), > a string in ISO8601 format (ex: "2009-11-05T13:15:30Z") or a UNIX > timestamp. (as seen in https://fullcalendar.io/docs1/event_data/Event_Object/) Before this commit we could for example in arabic provide an invalid date string "٢٠١٧-٠٣-١٦ ١٦:٠٠:٠٦" instead of "2017-03-16 16:00:06". This commit solves this by always providing fullcalendar an ISO8601 date string. opw-705752
-rw-r--r--addons/web_calendar/static/src/js/web_calendar.js4
1 files 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 b98f155ad9a..89d125c48af 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).format('YYYY-MM-DD HH:mm:ss'),
- 'end': moment(date_stop).format('YYYY-MM-DD HH:mm:ss'),
+ 'start': moment(date_start).toISOString(),
+ 'end': moment(date_stop).toISOString(),
'title': the_title,
'allDay': (this.fields[this.date_start].type == 'date' || (this.all_day && evt[this.all_day]) || false),
'id': evt.id,