diff options
| author | Christophe Matthieu <chm@odoo.com> | 2017-04-12 11:53:42 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2017-04-13 16:55:00 +0200 |
| commit | c32724eae06c987e74a0600f1669696e499edc33 (patch) | |
| tree | e80d8ccc3c08ec4a95889a06f6624e2c63b5bb29 /addons/web/static/src/js/core/session.js | |
| parent | 9c43ad85d463ef8f1fb4b8d16924bc71c0885a55 (diff) | |
[FIX] web: calendar timezone with user configuration
The client must receive the tzOffset to apply this on all hours.
To use the date picker we must change the date to apply the change
in the user's tzOffset, without this change the result is wrong.
For datetime widget we must change like it to avoid max stack error.
The server send the tzOffset, if it's undefined, by default the client
use the browser time offset.
Every test are change to use tzOffset.
A test is added in calendar to use the click by position for the
fullcalendar lib. This test create and drag and drop an event to check
timezone error and error when we use default value in the context.
Use formating date like 2026-04-04T08:00:00Z instead of 2026-04-04 08:00:00
is important for phantomjs, because it's crash without information if the
formating is not the standard format.
For the parsing, when the client receive a server date the date is utc
formating but when it's parsed from the client is in the user's timezone
Diffstat (limited to 'addons/web/static/src/js/core/session.js')
| -rw-r--r-- | addons/web/static/src/js/core/session.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/web/static/src/js/core/session.js b/addons/web/static/src/js/core/session.js index 0bd9dc19ad4..3a098bbe78c 100644 --- a/addons/web/static/src/js/core/session.js +++ b/addons/web/static/src/js/core/session.js @@ -285,6 +285,10 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, { var result = _.extend({}, window.odoo.session_info); delete result.session_id; _.extend(this, result); + if (!this.tzOffset) { + // send by server to have the user timezone and not the browser timezone + this.tzOffset = -new Date().getTimezoneOffset(); + } return $.when(); }, check_session_id: function () { |
