[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
This commit is contained in:
Nicolas Lempereur
2016-03-29 14:23:00 +02:00
parent e9bcaad09e
commit 9be7a9535c
@@ -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 : {