mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 11:57:16 +08:00
Merge pull request #6307 from artoscinote/ma_SCI_9338
Fix datepicker min/max limits [SCI-9338]
This commit is contained in:
commit
a499a0f0ea
1 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@
|
||||||
$('.calendar-input').slice(0, 2).each(function(index, element) {
|
$('.calendar-input').slice(0, 2).each(function(index, element) {
|
||||||
if ($(element).val().length > 0 ) {
|
if ($(element).val().length > 0 ) {
|
||||||
selectedDate.index = index;
|
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.date) {
|
||||||
if (selectedDate.index == 0) {
|
if (selectedDate.index == 0) {
|
||||||
options.minDate = new Date(selectedDate.date);
|
options.minDate = selectedDate.date;
|
||||||
} else if (selectedDate.index == 1) {
|
} else if (selectedDate.index == 1) {
|
||||||
options.maxDate = new Date(selectedDate.date);
|
options.maxDate = selectedDate.date;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue