';
- html += '';
- html += '';
-
- //adjust maxDate to reflect the maxSpan setting in order to
- //grey out end dates beyond the maxSpan
- if (this.endDate == null && this.maxSpan) {
- var maxLimit = this.startDate.clone().add(this.maxSpan).endOf('day');
- if (!maxDate || maxLimit.isBefore(maxDate)) {
- maxDate = maxLimit;
- }
- }
-
- for (var row = 0; row < 6; row++) {
- html += '
';
-
- // add week number
- if (this.showWeekNumbers)
- html += '
' + calendar[row][0].week() + '
';
- else if (this.showISOWeekNumbers)
- html += '
' + calendar[row][0].isoWeek() + '
';
-
- for (var col = 0; col < 7; col++) {
-
- var classes = [];
-
- //highlight today's date
- if (calendar[row][col].isSame(new Date(), "day"))
- classes.push('today');
-
- //highlight weekends
- if (calendar[row][col].isoWeekday() > 5)
- classes.push('weekend');
-
- //grey out the dates in other months displayed at beginning and end of this calendar
- if (calendar[row][col].month() != calendar[1][1].month())
- classes.push('off', 'ends');
-
- //don't allow selection of dates before the minimum date
- if (this.minDate && calendar[row][col].isBefore(this.minDate, 'day'))
- classes.push('off', 'disabled');
-
- //don't allow selection of dates after the maximum date
- if (maxDate && calendar[row][col].isAfter(maxDate, 'day'))
- classes.push('off', 'disabled');
-
- //don't allow selection of date if a custom function decides it's invalid
- if (this.isInvalidDate(calendar[row][col]))
- classes.push('off', 'disabled');
-
- //highlight the currently selected start date
- if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD'))
- classes.push('active', 'start-date');
-
- //highlight the currently selected end date
- if (this.endDate != null && calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD'))
- classes.push('active', 'end-date');
-
- //highlight dates in-between the selected dates
- if (this.endDate != null && calendar[row][col] > this.startDate && calendar[row][col] < this.endDate)
- classes.push('in-range');
-
- //apply custom classes for this date
- var isCustom = this.isCustomDate(calendar[row][col]);
- if (isCustom !== false) {
- if (typeof isCustom === 'string')
- classes.push(isCustom);
- else
- Array.prototype.push.apply(classes, isCustom);
- }
-
- var cname = '', disabled = false;
- for (var i = 0; i < classes.length; i++) {
- cname += classes[i] + ' ';
- if (classes[i] == 'disabled')
- disabled = true;
- }
- if (!disabled)
- cname += 'available';
-
- html += '
' + calendar[row][col].date() + '
';
-
- }
- html += '
';
- }
-
- html += '';
- html += '
';
-
- this.container.find('.drp-calendar.' + side + ' .calendar-table').html(html);
-
- },
-
- renderTimePicker: function(side) {
-
- // Don't bother updating the time picker if it's currently disabled
- // because an end date hasn't been clicked yet
- if (side == 'right' && !this.endDate) return;
-
- var html, selected, minDate, maxDate = this.maxDate;
-
- if (this.maxSpan && (!this.maxDate || this.startDate.clone().add(this.maxSpan).isBefore(this.maxDate)))
- maxDate = this.startDate.clone().add(this.maxSpan);
-
- if (side == 'left') {
- selected = this.startDate.clone();
- minDate = this.minDate;
- } else if (side == 'right') {
- selected = this.endDate.clone();
- minDate = this.startDate;
-
- //Preserve the time already selected
- var timeSelector = this.container.find('.drp-calendar.right .calendar-time');
- if (timeSelector.html() != '') {
-
- selected.hour(!isNaN(selected.hour()) ? selected.hour() : timeSelector.find('.hourselect option:selected').val());
- selected.minute(!isNaN(selected.minute()) ? selected.minute() : timeSelector.find('.minuteselect option:selected').val());
- selected.second(!isNaN(selected.second()) ? selected.second() : timeSelector.find('.secondselect option:selected').val());
-
- if (!this.timePicker24Hour) {
- var ampm = timeSelector.find('.ampmselect option:selected').val();
- if (ampm === 'PM' && selected.hour() < 12)
- selected.hour(selected.hour() + 12);
- if (ampm === 'AM' && selected.hour() === 12)
- selected.hour(0);
- }
-
- }
-
- if (selected.isBefore(this.startDate))
- selected = this.startDate.clone();
-
- if (maxDate && selected.isAfter(maxDate))
- selected = maxDate.clone();
-
- }
-
- //
- // hours
- //
-
- html = ' ';
-
- //
- // minutes
- //
-
- html += ': ';
-
- //
- // seconds
- //
-
- if (this.timePickerSeconds) {
- html += ': ';
- }
-
- //
- // AM/PM
- //
-
- if (!this.timePicker24Hour) {
- html += '';
- }
-
- this.container.find('.drp-calendar.' + side + ' .calendar-time').html(html);
-
- },
-
- updateFormInputs: function() {
-
- if (this.singleDatePicker || (this.endDate && (this.startDate.isBefore(this.endDate) || this.startDate.isSame(this.endDate)))) {
- this.container.find('button.applyBtn').prop('disabled', false);
- } else {
- this.container.find('button.applyBtn').prop('disabled', true);
- }
-
- },
-
- move: function() {
- var parentOffset = { top: 0, left: 0 },
- containerTop,
- drops = this.drops;
-
- var parentRightEdge = $(window).width();
- if (!this.parentEl.is('body')) {
- parentOffset = {
- top: this.parentEl.offset().top - this.parentEl.scrollTop(),
- left: this.parentEl.offset().left - this.parentEl.scrollLeft()
- };
- parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left;
- }
-
- switch (drops) {
- case 'auto':
- containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
- if (containerTop + this.container.outerHeight() >= this.parentEl[0].scrollHeight) {
- containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
- drops = 'up';
- }
- break;
- case 'up':
- containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
- break;
- default:
- containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
- break;
- }
-
- // Force the container to it's actual width
- this.container.css({
- top: 0,
- left: 0,
- right: 'auto'
- });
- var containerWidth = this.container.outerWidth();
-
- this.container.toggleClass('drop-up', drops == 'up');
-
- if (this.opens == 'left') {
- var containerRight = parentRightEdge - this.element.offset().left - this.element.outerWidth();
- if (containerWidth + containerRight > $(window).width()) {
- this.container.css({
- top: containerTop,
- right: 'auto',
- left: 9
- });
- } else {
- this.container.css({
- top: containerTop,
- right: containerRight,
- left: 'auto'
- });
- }
- } else if (this.opens == 'center') {
- var containerLeft = this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2
- - containerWidth / 2;
- if (containerLeft < 0) {
- this.container.css({
- top: containerTop,
- right: 'auto',
- left: 9
- });
- } else if (containerLeft + containerWidth > $(window).width()) {
- this.container.css({
- top: containerTop,
- left: 'auto',
- right: 0
- });
- } else {
- this.container.css({
- top: containerTop,
- left: containerLeft,
- right: 'auto'
- });
- }
- } else {
- var containerLeft = this.element.offset().left - parentOffset.left;
- if (containerLeft + containerWidth > $(window).width()) {
- this.container.css({
- top: containerTop,
- left: 'auto',
- right: 0
- });
- } else {
- this.container.css({
- top: containerTop,
- left: containerLeft,
- right: 'auto'
- });
- }
- }
- },
-
- show: function(e) {
- if (this.isShowing) return;
-
- // Create a click proxy that is private to this instance of datepicker, for unbinding
- this._outsideClickProxy = $.proxy(function(e) { this.outsideClick(e); }, this);
-
- // Bind global datepicker mousedown for hiding and
- $(document)
- .on('mousedown.daterangepicker', this._outsideClickProxy)
- // also support mobile devices
- .on('touchend.daterangepicker', this._outsideClickProxy)
- // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them
- .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy)
- // and also close when focus changes to outside the picker (eg. tabbing between controls)
- .on('focusin.daterangepicker', this._outsideClickProxy);
-
- // Reposition the picker if the window is resized while it's open
- $(window).on('resize.daterangepicker', $.proxy(function(e) { this.move(e); }, this));
-
- this.oldStartDate = this.startDate.clone();
- this.oldEndDate = this.endDate.clone();
- this.previousRightTime = this.endDate.clone();
-
- this.updateView();
- this.container.show();
- this.move();
- this.element.trigger('show.daterangepicker', this);
- this.isShowing = true;
- },
-
- hide: function(e) {
- if (!this.isShowing) return;
-
- //incomplete date selection, revert to last values
- if (!this.endDate) {
- this.startDate = this.oldStartDate.clone();
- this.endDate = this.oldEndDate.clone();
- }
-
- //if a new date range was selected, invoke the user callback function
- if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate))
- this.callback(this.startDate.clone(), this.endDate.clone(), this.chosenLabel);
-
- //if picker is attached to a text input, update it
- this.updateElement();
-
- $(document).off('.daterangepicker');
- $(window).off('.daterangepicker');
- this.container.hide();
- this.element.trigger('hide.daterangepicker', this);
- this.isShowing = false;
- },
-
- toggle: function(e) {
- if (this.isShowing) {
- this.hide();
- } else {
- this.show();
- }
- },
-
- outsideClick: function(e) {
- var target = $(e.target);
- // if the page is clicked anywhere except within the daterangerpicker/button
- // itself then call this.hide()
- if (
- // ie modal dialog fix
- e.type == "focusin" ||
- target.closest(this.element).length ||
- target.closest(this.container).length ||
- target.closest('.calendar-table').length
- ) return;
- this.hide();
- this.element.trigger('outsideClick.daterangepicker', this);
- },
-
- showCalendars: function() {
- this.container.addClass('show-calendar');
- this.move();
- this.element.trigger('showCalendar.daterangepicker', this);
- },
-
- hideCalendars: function() {
- this.container.removeClass('show-calendar');
- this.element.trigger('hideCalendar.daterangepicker', this);
- },
-
- clickRange: function(e) {
- var label = e.target.getAttribute('data-range-key');
- this.chosenLabel = label;
- if (label == this.locale.customRangeLabel) {
- this.showCalendars();
- } else {
- var dates = this.ranges[label];
- this.startDate = dates[0];
- this.endDate = dates[1];
-
- if (!this.timePicker) {
- this.startDate.startOf('day');
- this.endDate.endOf('day');
- }
-
- if (!this.alwaysShowCalendars)
- this.hideCalendars();
- this.clickApply();
- }
- },
-
- clickPrev: function(e) {
- var cal = $(e.target).parents('.drp-calendar');
- if (cal.hasClass('left')) {
- this.leftCalendar.month.subtract(1, 'month');
- if (this.linkedCalendars)
- this.rightCalendar.month.subtract(1, 'month');
- } else {
- this.rightCalendar.month.subtract(1, 'month');
- }
- this.updateCalendars();
- },
-
- clickNext: function(e) {
- var cal = $(e.target).parents('.drp-calendar');
- if (cal.hasClass('left')) {
- this.leftCalendar.month.add(1, 'month');
- } else {
- this.rightCalendar.month.add(1, 'month');
- if (this.linkedCalendars)
- this.leftCalendar.month.add(1, 'month');
- }
- this.updateCalendars();
- },
-
- hoverDate: function(e) {
-
- //ignore dates that can't be selected
- if (!$(e.target).hasClass('available')) return;
-
- var title = $(e.target).attr('data-title');
- var row = title.substr(1, 1);
- var col = title.substr(3, 1);
- var cal = $(e.target).parents('.drp-calendar');
- var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col];
-
- //highlight the dates between the start date and the date being hovered as a potential end date
- var leftCalendar = this.leftCalendar;
- var rightCalendar = this.rightCalendar;
- var startDate = this.startDate;
- if (!this.endDate) {
- this.container.find('.drp-calendar tbody td').each(function(index, el) {
-
- //skip week numbers, only look at dates
- if ($(el).hasClass('week')) return;
-
- var title = $(el).attr('data-title');
- var row = title.substr(1, 1);
- var col = title.substr(3, 1);
- var cal = $(el).parents('.drp-calendar');
- var dt = cal.hasClass('left') ? leftCalendar.calendar[row][col] : rightCalendar.calendar[row][col];
-
- if ((dt.isAfter(startDate) && dt.isBefore(date)) || dt.isSame(date, 'day')) {
- $(el).addClass('in-range');
- } else {
- $(el).removeClass('in-range');
- }
-
- });
- }
-
- },
-
- clickDate: function(e) {
-
- if (!$(e.target).hasClass('available')) return;
-
- var title = $(e.target).attr('data-title');
- var row = title.substr(1, 1);
- var col = title.substr(3, 1);
- var cal = $(e.target).parents('.drp-calendar');
- var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col];
-
- //
- // this function needs to do a few things:
- // * alternate between selecting a start and end date for the range,
- // * if the time picker is enabled, apply the hour/minute/second from the select boxes to the clicked date
- // * if autoapply is enabled, and an end date was chosen, apply the selection
- // * if single date picker mode, and time picker isn't enabled, apply the selection immediately
- // * if one of the inputs above the calendars was focused, cancel that manual input
- //
-
- if (this.endDate || date.isBefore(this.startDate, 'day')) { //picking start
- if (this.timePicker) {
- var hour = parseInt(this.container.find('.left .hourselect').val(), 10);
- if (!this.timePicker24Hour) {
- var ampm = this.container.find('.left .ampmselect').val();
- if (ampm === 'PM' && hour < 12)
- hour += 12;
- if (ampm === 'AM' && hour === 12)
- hour = 0;
- }
- var minute = parseInt(this.container.find('.left .minuteselect').val(), 10);
- if (isNaN(minute)) {
- minute = parseInt(this.container.find('.left .minuteselect option:last').val(), 10);
- }
- var second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0;
- date = date.clone().hour(hour).minute(minute).second(second);
- }
- this.endDate = null;
- this.setStartDate(date.clone());
- } else if (!this.endDate && date.isBefore(this.startDate)) {
- //special case: clicking the same date for start/end,
- //but the time of the end date is before the start date
- this.setEndDate(this.startDate.clone());
- } else { // picking end
- if (this.timePicker) {
- var hour = parseInt(this.container.find('.right .hourselect').val(), 10);
- if (!this.timePicker24Hour) {
- var ampm = this.container.find('.right .ampmselect').val();
- if (ampm === 'PM' && hour < 12)
- hour += 12;
- if (ampm === 'AM' && hour === 12)
- hour = 0;
- }
- var minute = parseInt(this.container.find('.right .minuteselect').val(), 10);
- if (isNaN(minute)) {
- minute = parseInt(this.container.find('.right .minuteselect option:last').val(), 10);
- }
- var second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0;
- date = date.clone().hour(hour).minute(minute).second(second);
- }
- this.setEndDate(date.clone());
- if (this.autoApply) {
- this.calculateChosenLabel();
- this.clickApply();
- }
- }
-
- if (this.singleDatePicker) {
- this.setEndDate(this.startDate);
- if (!this.timePicker && this.autoApply)
- this.clickApply();
- }
-
- this.updateView();
-
- //This is to cancel the blur event handler if the mouse was in one of the inputs
- e.stopPropagation();
-
- },
-
- calculateChosenLabel: function () {
- var customRange = true;
- var i = 0;
- for (var range in this.ranges) {
- if (this.timePicker) {
- var format = this.timePickerSeconds ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD HH:mm";
- //ignore times when comparing dates if time picker seconds is not enabled
- if (this.startDate.format(format) == this.ranges[range][0].format(format) && this.endDate.format(format) == this.ranges[range][1].format(format)) {
- customRange = false;
- this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key');
- break;
- }
- } else {
- //ignore times when comparing dates if time picker is not enabled
- if (this.startDate.format('YYYY-MM-DD') == this.ranges[range][0].format('YYYY-MM-DD') && this.endDate.format('YYYY-MM-DD') == this.ranges[range][1].format('YYYY-MM-DD')) {
- customRange = false;
- this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key');
- break;
- }
- }
- i++;
- }
- if (customRange) {
- if (this.showCustomRangeLabel) {
- this.chosenLabel = this.container.find('.ranges li:last').addClass('active').attr('data-range-key');
- } else {
- this.chosenLabel = null;
- }
- this.showCalendars();
- }
- },
-
- clickApply: function(e) {
- this.hide();
- this.element.trigger('apply.daterangepicker', this);
- },
-
- clickCancel: function(e) {
- this.startDate = this.oldStartDate;
- this.endDate = this.oldEndDate;
- this.hide();
- this.element.trigger('cancel.daterangepicker', this);
- },
-
- monthOrYearChanged: function(e) {
- var isLeft = $(e.target).closest('.drp-calendar').hasClass('left'),
- leftOrRight = isLeft ? 'left' : 'right',
- cal = this.container.find('.drp-calendar.'+leftOrRight);
-
- // Month must be Number for new moment versions
- var month = parseInt(cal.find('.monthselect').val(), 10);
- var year = cal.find('.yearselect').val();
-
- if (!isLeft) {
- if (year < this.startDate.year() || (year == this.startDate.year() && month < this.startDate.month())) {
- month = this.startDate.month();
- year = this.startDate.year();
- }
- }
-
- if (this.minDate) {
- if (year < this.minDate.year() || (year == this.minDate.year() && month < this.minDate.month())) {
- month = this.minDate.month();
- year = this.minDate.year();
- }
- }
-
- if (this.maxDate) {
- if (year > this.maxDate.year() || (year == this.maxDate.year() && month > this.maxDate.month())) {
- month = this.maxDate.month();
- year = this.maxDate.year();
- }
- }
-
- if (isLeft) {
- this.leftCalendar.month.month(month).year(year);
- if (this.linkedCalendars)
- this.rightCalendar.month = this.leftCalendar.month.clone().add(1, 'month');
- } else {
- this.rightCalendar.month.month(month).year(year);
- if (this.linkedCalendars)
- this.leftCalendar.month = this.rightCalendar.month.clone().subtract(1, 'month');
- }
- this.updateCalendars();
- },
-
- timeChanged: function(e) {
-
- var cal = $(e.target).closest('.drp-calendar'),
- isLeft = cal.hasClass('left');
-
- var hour = parseInt(cal.find('.hourselect').val(), 10);
- var minute = parseInt(cal.find('.minuteselect').val(), 10);
- if (isNaN(minute)) {
- minute = parseInt(cal.find('.minuteselect option:last').val(), 10);
- }
- var second = this.timePickerSeconds ? parseInt(cal.find('.secondselect').val(), 10) : 0;
-
- if (!this.timePicker24Hour) {
- var ampm = cal.find('.ampmselect').val();
- if (ampm === 'PM' && hour < 12)
- hour += 12;
- if (ampm === 'AM' && hour === 12)
- hour = 0;
- }
-
- if (isLeft) {
- var start = this.startDate.clone();
- start.hour(hour);
- start.minute(minute);
- start.second(second);
- this.setStartDate(start);
- if (this.singleDatePicker) {
- this.endDate = this.startDate.clone();
- } else if (this.endDate && this.endDate.format('YYYY-MM-DD') == start.format('YYYY-MM-DD') && this.endDate.isBefore(start)) {
- this.setEndDate(start.clone());
- }
- } else if (this.endDate) {
- var end = this.endDate.clone();
- end.hour(hour);
- end.minute(minute);
- end.second(second);
- this.setEndDate(end);
- }
-
- //update the calendars so all clickable dates reflect the new time component
- this.updateCalendars();
-
- //update the form inputs above the calendars with the new time
- this.updateFormInputs();
-
- //re-render the time pickers because changing one selection can affect what's enabled in another
- this.renderTimePicker('left');
- this.renderTimePicker('right');
-
- },
-
- elementChanged: function() {
- if (!this.element.is('input')) return;
- if (!this.element.val().length) return;
-
- var dateString = this.element.val().split(this.locale.separator),
- start = null,
- end = null;
-
- if (dateString.length === 2) {
- start = moment(dateString[0], this.locale.format);
- end = moment(dateString[1], this.locale.format);
- }
-
- if (this.singleDatePicker || start === null || end === null) {
- start = moment(this.element.val(), this.locale.format);
- end = start;
- }
-
- if (!start.isValid() || !end.isValid()) return;
-
- this.setStartDate(start);
- this.setEndDate(end);
- this.updateView();
- },
-
- keydown: function(e) {
- //hide on tab or enter
- if ((e.keyCode === 9) || (e.keyCode === 13)) {
- this.hide();
- }
-
- //hide on esc and prevent propagation
- if (e.keyCode === 27) {
- e.preventDefault();
- e.stopPropagation();
-
- this.hide();
- }
- },
-
- updateElement: function() {
- if (this.element.is('input') && this.autoUpdateInput) {
- var newValue = this.startDate.format(this.locale.format);
- if (!this.singleDatePicker) {
- newValue += this.locale.separator + this.endDate.format(this.locale.format);
- }
- if (newValue !== this.element.val()) {
- this.element.val(newValue).trigger('change');
- }
- }
- },
-
- remove: function() {
- this.container.remove();
- this.element.off('.daterangepicker');
- this.element.removeData();
- }
-
- };
-
- $.fn.daterangepicker = function(options, callback) {
- var implementOptions = $.extend(true, {}, $.fn.daterangepicker.defaultOptions, options);
- this.each(function() {
- var el = $(this);
- if (el.data('daterangepicker'))
- el.data('daterangepicker').remove();
- el.data('daterangepicker', new DateRangePicker(el, implementOptions, callback));
- });
- return this;
- };
-
- return DateRangePicker;
-
-}));
diff --git a/addons/web/static/src/legacy/js/libs/daterangepicker.js b/addons/web/static/src/legacy/js/libs/daterangepicker.js
deleted file mode 100644
index f26a5394ce5..00000000000
--- a/addons/web/static/src/legacy/js/libs/daterangepicker.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/** @odoo-module **/
-
-/**
- * Don't allow user to select off days(Dates which are out of current calendar).
- */
-var clickDateFunction = daterangepicker.prototype.clickDate;
-daterangepicker.prototype.clickDate = function (ev) {
- if (!$(ev.target).hasClass('off')) {
- clickDateFunction.apply(this, arguments);
- }
-};
-
-/**
- * Override to open up or down based on top/bottom space in window.
- */
-const moveFunction = daterangepicker.prototype.move;
-daterangepicker.prototype.move = function () {
- const offset = this.element.offset();
- this.drops = this.container.height() < offset.top ? 'up' : 'down';
- moveFunction.apply(this, arguments);
-};
diff --git a/addons/web/static/src/legacy/scss/daterangepicker.scss b/addons/web/static/src/legacy/scss/daterangepicker.scss
deleted file mode 100644
index 115a5a1e308..00000000000
--- a/addons/web/static/src/legacy/scss/daterangepicker.scss
+++ /dev/null
@@ -1,177 +0,0 @@
-// Match DateTimePicker styling
-
-.daterangepicker.show-calendar {
- --daterangepicker-border: #{$dropdown-border-width} solid #{$dropdown-border-color};
- --daterangepicker-border-radius: #{$dropdown-border-radius};
- --daterangepicker-bg: #{$dropdown-bg};
- --daterangepicker-color: #{map-get($grays, '900')};
-
- @if $enable-shadows {
- --daterangepicker-box-shadow: #{$dropdown-box-shadow};
- }
-
- --daterangepicker__table-bg: #{$table-bg};
- --daterangepicker__thead-bg: #{map-get($grays, '100')};
-
- --daterangepicker__cell-border-color: #{$table-border-color};
- --daterangepicker__cell-bg--hover: #{map-get($grays, '100')};
-
- --daterangepicker__select-bg: #{$form-select-bg};
- --daterangepicker__select-border-color: #{$input-border-color};
- --daterangepicker__select-color: #{$form-select-color};
-
-
- border: var(--daterangepicker-border);
- border-radius: var(--daterangepicker-border-radius);
- background-color: var(--daterangepicker-bg);
- box-shadow: var(--daterangepicker-box-shadow);
- font-family: inherit;
-
- &:before {
- border-bottom-color: var(--daterangerpicker__arrow-border-color, #{$dropdown-border-color});
- }
-
- &:after {
- border-bottom-color: var(--daterangerpicker__arrow-background-color, #{$dropdown-bg});
- }
-
- .calendar-table {
- border: 0;
- background-color: var(--daterangepicker__table-bg);
-
- .next span, .prev span {
- border-color: var(--daterangepicker-color);
- }
-
- td, th {
- border-bottom-color: var(--daterangepicker__cell-border-color);
-
- &, &.start-date.end-date {
- border-radius: 0;
- }
-
- &:not(.active) {
- color: var(--daterangepicker-color);
-
- }
- &.available:hover {
- background-color: var(--daterangepicker__cell-bg--hover);
- }
-
-
- &.prev, &.next, &.off.ends {
- @include o-hover-opacity(.5);
- }
- }
-
- td {
- font-size: ($font-size-base + $font-size-sm) * .5;
-
- &.today {
- position: relative;
-
- &:before {
- content: '';
- display: inline-block;
- position: absolute;
- bottom: 4px;
- right: 4px;
- border: solid transparent;
- border-width: 0 0 7px 7px;
- border-bottom-color: $o-brand-primary;
- border-top-color: $dropdown-border-color;
- }
- }
-
- &.in-range {
- background-color: rgba($o-brand-odoo, 0.3);
- color: $o-main-text-color;
- text-shadow: none;
- }
-
- &.active,
- &.active:hover,
- &.in-range:hover {
- background-color: $o-brand-odoo;
- color: $white;
- text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
- }
-
- &.off {
- background-color: var(--daterangepicker__cell-bg--off, #{rgba($secondary, .1)});
- }
-
- }
-
- thead tr {
- &:nth-child(1) th {
- height: 30px;
- line-height: 30px;
-
- &.month {
- font-size: $font-size-lg;
- }
- }
- &:nth-child(2) th {
- background-color: var(--daterangepicker__thead-bg);
- font-size: $font-size-sm;
- font-weight: $font-weight-bold;
- color: $o-main-text-color;
- }
- }
- }
-
- .calendar-time {
- /*rtl:ignore*/
- direction:ltr;
- select {
- &.hourselect, &.minuteselect, &.secondselect, &.ampmselect {
- display: initial;
- border-color: var(--daterangepicker__select-border-color);
- background-color: var(--daterangepicker__select-bg);
- color: var(--daterangepicker__select-color);
- -webkit-appearance: menulist-button;
- -moz-appearance: menulist-button;
- appearance: menulist-button;
- }
- }
- }
-
- .drp-buttons {
- border-top: 0;
-
- .btn {
- text-transform: uppercase;
- font-weight: $btn-font-weight;
- }
-
- .drp-selected {
- display: none;
- }
- }
-
- @include media-breakpoint-down(sm) {
- position: fixed;
- top: auto !important;
- left: 0 !important;
- bottom: 0;
- right: 0 !important;
- width: auto;
- max-height: 90vh;
- overflow-y: auto;
- @include border-top-radius(1rem);
- box-shadow: $box-shadow-lg;
-
- .drp-calendar {
- max-width: inherit;
- padding-right: 0 !important;
- padding-left: 0 !important;
- }
-
- .drp-buttons {
- position: sticky;
- bottom: 0;
- background-color: #fff;
- }
- }
-}
diff --git a/addons/web/static/tests/views/list_view_tests.js b/addons/web/static/tests/views/list_view_tests.js
index 6ad8ffcb9e1..9efd245267d 100644
--- a/addons/web/static/tests/views/list_view_tests.js
+++ b/addons/web/static/tests/views/list_view_tests.js
@@ -11092,7 +11092,7 @@ QUnit.module("Views", (hooks) => {
await click(target.querySelector(".o_data_row .o_data_cell")); // edit first row
await click(target.querySelector(".o_data_row .o_data_cell .o_field_daterange input"));
- // change dates via the daterangepicker
+ // change dates range
await click(getPickerCell("16").at(0));
await click(getPickerCell("12").at(1));
assert.notOk(getPickerApplyButton().disabled);
diff --git a/addons/web_tour/static/src/tour_service/tour_compilers.js b/addons/web_tour/static/src/tour_service/tour_compilers.js
index f9da0055e44..2828da7e2d6 100644
--- a/addons/web_tour/static/src/tour_service/tour_compilers.js
+++ b/addons/web_tour/static/src/tour_service/tour_compilers.js
@@ -131,11 +131,6 @@ function getAnchorEl(el, consumeEvent) {
if (consumeEvent === "input" && !["textarea", "input"].includes(el.tagName.toLowerCase())) {
return el.closest("[contenteditable='true']");
}
- if (consumeEvent.includes("apply.daterangepicker")) {
- return [...el.parentElement.children].find((child) =>
- child.classList.contains("o_field_date_range")
- );
- }
if (consumeEvent === "sort") {
// when an element is dragged inside a sortable container (with classname
// 'ui-sortable'), jQuery triggers the 'sort' event on the container
diff --git a/addons/web_tour/static/src/tour_service/tour_utils.js b/addons/web_tour/static/src/tour_service/tour_utils.js
index 5d9db91ce1c..a2d66b76d6a 100644
--- a/addons/web_tour/static/src/tour_service/tour_utils.js
+++ b/addons/web_tour/static/src/tour_service/tour_utils.js
@@ -94,10 +94,6 @@ export function getConsumeEventType(element, runCommand) {
(!type ||
["email", "number", "password", "search", "tel", "text", "url"].includes(type)))
) {
- // FieldDateRange triggers a special event when using the widget
- if (classList.contains("o_field_date_range")) {
- return "apply.daterangepicker input";
- }
if (
utils.isSmall() &&
element.closest(".o_field_widget")?.matches(".o_field_many2one, .o_field_many2many")
diff --git a/addons/website_slides/__manifest__.py b/addons/website_slides/__manifest__.py
index 328edbbb35e..e92c079d2e5 100644
--- a/addons/website_slides/__manifest__.py
+++ b/addons/website_slides/__manifest__.py
@@ -143,7 +143,6 @@ Featuring
'web/static/src/legacy/scss/ui.scss',
'web/static/src/legacy/scss/mimetypes.scss',
'web/static/src/legacy/scss/modal.scss',
- 'web/static/src/legacy/scss/daterangepicker.scss',
'web/static/src/legacy/scss/popover.scss',
'web/static/src/legacy/scss/translation_dialog.scss',
'web/static/src/legacy/scss/keyboard.scss',
diff --git a/debian/copyright b/debian/copyright
index 835ec78a6cb..64da842b048 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -233,10 +233,6 @@ Files: addons/web/static/lib/clipboard/clipboard.js
Copyright: Zeno Rocha
License: MIT
-Files: addons/web/static/lib/daterangepicker/*
-Copyright: 2012-2019 Dan Grossman
-License: MIT
-
Files: addons/web/static/lib/es6-promise/*
Copyright: 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors
License: MIT