Merge pull request #5909 from G-Chubinidze/gc_SCI_8796

Date range in filters allows start date to be after end date [SCI-8796]
This commit is contained in:
Martin Artnik 2023-09-13 13:37:03 +02:00 committed by GitHub
commit 631d987b92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,26 @@
ev.stopPropagation();
let dt = $(this);
let options = { ignoreReadonly: true };
let selectedDate = {};
$('.calendar-input').slice(0, 2).each(function(index, element) {
if ($(element).val().length > 0 ) {
selectedDate.index = index;
selectedDate.date = $(element).val();
}
});
let options = {
ignoreReadonly: true
};
if (selectedDate.date) {
if (selectedDate.index == 0) {
options.minDate = new Date(selectedDate.date);
} else if (selectedDate.index == 1) {
options.maxDate = new Date(selectedDate.date);
}
}
if (dt.data('DateTimePicker')) {
dt.data('DateTimePicker').destroy();