diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2016-03-29 12:51:51 +0200 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2016-03-29 14:23:00 +0200 |
| commit | 9be7a9535ca1c5a9884ef06b7a567bf42ebdce0a (patch) | |
| tree | 12b470c71b6606cde87258263ebeb66b7254e71b /addons/web_calendar/static/src/js | |
| parent | e9bcaad09e98dba9dd12ae01c25246798a07a87f (diff) | |
[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
Diffstat (limited to 'addons/web_calendar/static/src/js')
| -rw-r--r-- | addons/web_calendar/static/src/js/web_calendar.js | 3 |
1 files changed, 3 insertions, 0 deletions
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 : { |
