mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-31 04:32:06 +08:00
Fix datepicker min/max limits [SCI-9338]
This commit is contained in:
parent
d44d29a0fd
commit
99dd94e21f
1 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@
|
|||
$('.calendar-input').slice(0, 2).each(function(index, element) {
|
||||
if ($(element).val().length > 0 ) {
|
||||
selectedDate.index = index;
|
||||
selectedDate.date = $(element).val();
|
||||
selectedDate.date = moment($(element).val(), element.dataset.dateFormat).toDate();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -21,9 +21,9 @@
|
|||
|
||||
if (selectedDate.date) {
|
||||
if (selectedDate.index == 0) {
|
||||
options.minDate = new Date(selectedDate.date);
|
||||
options.minDate = selectedDate.date;
|
||||
} else if (selectedDate.index == 1) {
|
||||
options.maxDate = new Date(selectedDate.date);
|
||||
options.maxDate = selectedDate.date;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue