[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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user