diff options
| author | Cedric Snauwaert <csn@openerp.com> | 2014-09-11 15:02:12 +0200 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2014-11-05 15:27:59 +0100 |
| commit | a8d9743c0cc2dda11fdcb72e38b209cd74f102b0 (patch) | |
| tree | a8a8c56adea81f8dc976f87946b65a8ff0cb9378 /addons/web/static/src/js | |
| parent | ef886aed2f4c7d9b78123d1cd980a899bf6b20ea (diff) | |
[FIX] web: fix tests on date parsing
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/formats.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index 3c044bdff99..3f04025f265 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -171,15 +171,23 @@ instance.web.format_value = function (value, descriptor, value_if_empty) { case 'datetime': if (typeof(value) == "string") value = new moment(instance.web.auto_str_to_date(value)); - + else { + value = new moment(value); + } return value.format(date_format + ' ' + time_format); case 'date': if (typeof(value) == "string") value = new moment(instance.web.str_to_date(value.substring(0,10))); + else { + value = new moment(value); + } return value.format(date_format); case 'time': if (typeof(value) == "string") value = new moment(instance.web.auto_str_to_date(value)); + else { + value = new moment(value); + } return value.format(time_format); case 'selection': case 'statusbar': // Each choice is [value, label] |
