diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2018-04-11 14:58:25 +0200 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2018-04-16 00:22:18 -1200 |
| commit | 7680635c541502dcf207378a8ffe2f444e82878d (patch) | |
| tree | f98836c451ff7d21f2cdd16e20ecfed672bd587d /addons/web/static/src/js/views/basic/basic_model.js | |
| parent | 620a6f45576a9846bbfc756d90a01e7c1d47c8f8 (diff) | |
[FIX] web: setDate mixing utc+tz and local date
In the calendar view there is some mixing of moment with:
- a local date with given timezone
- a UTC date with added timezone manually applied
The setDate function of calendar model sometimes received either of the
two types, and always transforms them to UTC date with added timezone.
This cause eg. the following issues:
- in the minicalendar, if we click on a day (eg. 12) the day highlighed
will be the one of 12th at midnight with timezone applied. So with a
negative timezone the 11th would be highlighted in the mini calendar
(but the 12th would still be the day shown).
- if we change scale (week/day/month) or open calendar or use next or
previous button: we call `setDate` with a UTC+timezone moment. So each
time this is done, we get an additional timezone
eg. when opening the calendar view on the 12th at 5:00 with GMT-0200:
-> the target date is 12th at 1:00
-> if we set the day mode: target date is 11th at 23:00
-> if we set the week mode: target date is 11th at 21:00
With this change we keep target_date and highlight_date as local date so
setDate always receives a local date and jquery-ui DatePicker gets the
date in the expected format.
opw-1831368
closes #24188
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
0 files changed, 0 insertions, 0 deletions
