From d2e24f54442ad3ed869b071f96b5bdbc4ce55e22 Mon Sep 17 00:00:00 2001 From: Xavier Dubuc Date: Thu, 13 Feb 2020 13:15:02 +0000 Subject: [IMP] js: time.js inner functions call improvement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some functions defined in this file use another function present in the same file through "this" keyword even if it's not needed. This cause problems when these function are required in another file using object destructuring. This commit fix this issue by calling the function only by its name. closes odoo/odoo#45299 Signed-off-by: Sébastien Theys (seb) --- addons/web/static/src/js/core/time.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'addons/web/static/src/js/core/time.js') diff --git a/addons/web/static/src/js/core/time.js b/addons/web/static/src/js/core/time.js index 8bce87e3109..3e677c4201a 100644 --- a/addons/web/static/src/js/core/time.js +++ b/addons/web/static/src/js/core/time.js @@ -283,21 +283,21 @@ var inverse_normalize_format_table = _.invert(normalize_format_table); * Get date format of the user's language */ function getLangDateFormat() { - return this.strftime_to_moment_format(_t.database.parameters.date_format); + return strftime_to_moment_format(_t.database.parameters.date_format); } /** * Get time format of the user's language */ function getLangTimeFormat() { - return this.strftime_to_moment_format(_t.database.parameters.time_format); + return strftime_to_moment_format(_t.database.parameters.time_format); } /** * Get date time format of the user's language */ function getLangDatetimeFormat() { - return this.strftime_to_moment_format(_t.database.parameters.date_format + " " + _t.database.parameters.time_format); + return strftime_to_moment_format(_t.database.parameters.date_format + " " + _t.database.parameters.time_format); } -- cgit v1.2.3