mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-18 05:20:54 +08:00
Date range in filters allows start date to be after end date [SCI-8796]
This commit is contained in:
parent
8aa06bf4af
commit
a98137bb57
1 changed files with 20 additions and 1 deletions
|
@ -6,7 +6,26 @@
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
|
|
||||||
let dt = $(this);
|
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')) {
|
if (dt.data('DateTimePicker')) {
|
||||||
dt.data('DateTimePicker').destroy();
|
dt.data('DateTimePicker').destroy();
|
||||||
|
|
Loading…
Reference in a new issue