Skip to content

Commit

Permalink
[IMP] web_calendar: matching pivot and calendar week number
Browse files Browse the repository at this point in the history
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 odoo#11522
opw-653671
opw-668711
  • Loading branch information
nle-odoo committed Mar 29, 2016
1 parent e9bcaad commit 9be7a95
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/web_calendar/static/src/js/web_calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 : {
Expand Down

0 comments on commit 9be7a95

Please sign in to comment.