From 66e1ce8606643eb0490584356f2d7b60cfffd3e6 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 8 Mar 2012 11:21:51 +0100 Subject: [PATCH] [FIX] Missing date.js CultureInfo's am/pm descriptor causes wrong dates to be sent to server without user's knowledge lp bug: https://launchpad.net/bugs/938497 fixed bzr revid: fme@openerp.com-20120308102151-eyr71rzk345f6xji --- addons/web/static/src/js/core.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 106d2b86dc9..49840e5aba8 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -744,6 +744,14 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. var file_list = ["/web/static/lib/datejs/globalization/" + lang.replace("_", "-") + ".js"]; return self.rpc('/web/webclient/jslist', {mods: to_load}).pipe(function(files) { return self.do_load_js(file_list.concat(files)); + }).then(function () { + if (!Date.CultureInfo.pmDesignator) { + // If no am/pm designator is specified but the openerp + // datetime format uses %i, date.js won't be able to + // correctly format a date. See bug#938497. + Date.CultureInfo.amDesignator = 'AM'; + Date.CultureInfo.pmDesignator = 'PM'; + } }); })) }