From 9be7a9535ca1c5a9884ef06b7a567bf42ebdce0a Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 29 Mar 2016 12:51:51 +0200 Subject: [PATCH] [IMP] web_calendar: matching pivot and calendar week number To format Week numbers in the pivot view, babel is used with format `'W'w YYYY` in the current locale (eg: en_US) which will determine print the week in the locale week numbering type. This is inconsistant with the fullcalendar version (1.6.4) in Odoo until at least version 9.0 where ISO is used by default. This behaviour has been changed in more recent version of fullcalendar and is now in tune with pivot view, but updating fullcalendar should be done in master. This commit customize the week numbering on the old version of fullcalendar getting the yearned result without updating fullcalendar. This is only possible in saas-6 since momentjs is only present since saas-6 and is required for this fix. closes #11522 opw-653671 opw-668711 --- addons/web_calendar/static/src/js/web_calendar.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web_calendar/static/src/js/web_calendar.js b/addons/web_calendar/static/src/js/web_calendar.js index 70a46143aec..e3cc6e0e8d4 100644 --- a/addons/web_calendar/static/src/js/web_calendar.js +++ b/addons/web_calendar/static/src/js/web_calendar.js @@ -50,6 +50,9 @@ openerp.web_calendar = function(instance) { dayNames: moment.weekdays(), dayNamesShort: moment.weekdaysShort(), firstDay: moment._locale._week.dow, + weekNumberCalculation: function(date) { + return moment(date).week(); + }, weekNumbers: true, axisFormat : shortTimeformat.replace(/:mm/,'(:mm)'), timeFormat : {