diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-06-21 15:41:28 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2018-07-27 12:36:54 +0200 |
| commit | 43d2db9439f321e356a62de986d59ba43b31436b (patch) | |
| tree | 8840fd419e56e5d225a76566dcaa43a29e7aca29 /addons/web/static/lib | |
| parent | 6692919d1efc63ff2a28909c4155b99791d4bf79 (diff) | |
[FIX] web: restore datepicker lib patches
Patches were introduced by Odoo in the lib and have been removed
while updating it to "tempus dominus". This commit restores them.
See:
- https://github.com/odoo/odoo/commit/3741603495532e218b66f3cfa0272e4536f1cf2c
- https://github.com/odoo/odoo/commit/ab42507d460125c5ee81bb6b4b859146494339ac
Diffstat (limited to 'addons/web/static/lib')
| -rw-r--r-- | addons/web/static/lib/tempusdominus/tempusdominus.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/addons/web/static/lib/tempusdominus/tempusdominus.js b/addons/web/static/lib/tempusdominus/tempusdominus.js index 77f6e2a4476..63daabbd6f7 100644 --- a/addons/web/static/lib/tempusdominus/tempusdominus.js +++ b/addons/web/static/lib/tempusdominus/tempusdominus.js @@ -561,9 +561,18 @@ var DateTimePicker = function ($, moment) { }; DateTimePicker.prototype._notifyEvent = function _notifyEvent(e) { - if (e.type === DateTimePicker.Event.CHANGE && e.date && e.date.isSame(e.oldDate) || !e.date && !e.oldDate) { + // /!\ ODOO FIX: these next conditions have been modified by odoo + // FIXME should write a test about the tricky case this handles + if (!e.date && !e.oldDate) { return; } + if (e.type === DateTimePicker.Event.CHANGE) { + // check _isUTC flag to ensure that we are not comparing apples and oranges + var bothUTC = e.date && e.oldDate && e.date._isUTC === e.oldDate._isUTC; + if (bothUTC && e.date.isSame(e.oldDate)) { + return; + } + } this._element.trigger(e); }; @@ -1856,6 +1865,11 @@ var TempusDominusBootstrap4 = function ($) { self._element.children().first().after(self.widget); } + // /!\ ODOO FIX: the 3 next lines have been *added* by odoo + var parentOffset = parent.offset(); + position.top = offset.top - parentOffset.top; + position.left = offset.left - parentOffset.left; + // Top and bottom logic if (vertical === 'auto') { //noinspection JSValidateTypes |
