summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/core
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js/core')
-rw-r--r--addons/web/static/src/js/core/session.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/addons/web/static/src/js/core/session.js b/addons/web/static/src/js/core/session.js
index 09d765fbc5b..4c8a63dbdb5 100644
--- a/addons/web/static/src/js/core/session.js
+++ b/addons/web/static/src/js/core/session.js
@@ -207,6 +207,8 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
}
return loaded.then(function () {
return self.load_js(file_list);
+ }).then(function () {
+ self._configureLocale();
});
},
load_translations: function () {
@@ -362,6 +364,23 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
},
//--------------------------------------------------------------------------
+ // Private
+ //--------------------------------------------------------------------------
+
+ /**
+ * Sets first day of week in current locale according to the user language.
+ *
+ * @private
+ */
+ _configureLocale: function () {
+ moment.updateLocale(moment.locale(), {
+ week: {
+ dow: (_t.database.parameters.week_start || 0) % 7,
+ },
+ });
+ },
+
+ //--------------------------------------------------------------------------
// Handlers
//--------------------------------------------------------------------------