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