mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
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:
commit
631d987b92
1 changed files with 20 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue