diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-04-16 19:50:50 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-04-16 19:50:50 +0200 |
| commit | 74033eb007749c88b84ea883b006a5877355306e (patch) | |
| tree | 8f8b6cb22cc2bf6046ba04e388ea29855a33c597 /addons/web/static/src/js/widgets/date_picker.js | |
| parent | 71cdefd9f41881d9720433d5fc7732759098f9a4 (diff) | |
| parent | 90f8f17fb4fc795c2c12d68d21900e81f3d7a223 (diff) | |
[MERGE] forward port branch saas-11.2 up to 90f8f17fb4f
Diffstat (limited to 'addons/web/static/src/js/widgets/date_picker.js')
| -rw-r--r-- | addons/web/static/src/js/widgets/date_picker.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/web/static/src/js/widgets/date_picker.js b/addons/web/static/src/js/widgets/date_picker.js index 8d0b04332ad..8f87b36c874 100644 --- a/addons/web/static/src/js/widgets/date_picker.js +++ b/addons/web/static/src/js/widgets/date_picker.js @@ -79,8 +79,15 @@ var DateWidget = Widget.extend({ var oldValue = this.getValue(); this._setValueFromUi(); var newValue = this.getValue(); - - if (!oldValue !== !newValue || oldValue && newValue && !oldValue.isSame(newValue)) { + var hasChanged = !oldValue !== !newValue; + if (oldValue && newValue) { + var formattedOldValue = oldValue.format(time.getLangDatetimeFormat()); + var formattedNewValue = newValue.format(time.getLangDatetimeFormat()) + if (formattedNewValue !== formattedOldValue) { + hasChanged = true; + } + } + if (hasChanged) { // The condition is strangely written; this is because the // values can be false/undefined this.trigger("datetime_changed"); |
