mirror of
https://github.com/frappe/air-datepicker.git
synced 2026-01-14 11:01:22 +08:00
modify multipleDates param, now its possible to pass number as value
This commit is contained in:
parent
0bc3739697
commit
cec8f2a1f6
4
dist/js/datepicker.js
vendored
4
dist/js/datepicker.js
vendored
@ -33,8 +33,7 @@ var Datepicker;
|
|||||||
maxDate: '',
|
maxDate: '',
|
||||||
disableNavWhenOutOfRange: true,
|
disableNavWhenOutOfRange: true,
|
||||||
|
|
||||||
//TODO возможно добавить огрнаичивать число выделяемых дат
|
multipleDates: false, // Boolean or Number
|
||||||
multipleDates: false,
|
|
||||||
multipleDatesSeparator: ',',
|
multipleDatesSeparator: ',',
|
||||||
|
|
||||||
// navigation
|
// navigation
|
||||||
@ -222,6 +221,7 @@ var Datepicker;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.opts.multipleDates) {
|
if (this.opts.multipleDates) {
|
||||||
|
if (this.selectedDates.length === this.opts.multipleDates) return;
|
||||||
if (!this._isSelected(date)) {
|
if (!this._isSelected(date)) {
|
||||||
this.selectedDates.push(date);
|
this.selectedDates.push(date);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,8 +33,7 @@ var Datepicker;
|
|||||||
maxDate: '',
|
maxDate: '',
|
||||||
disableNavWhenOutOfRange: true,
|
disableNavWhenOutOfRange: true,
|
||||||
|
|
||||||
//TODO возможно добавить огрнаичивать число выделяемых дат
|
multipleDates: false, // Boolean or Number
|
||||||
multipleDates: false,
|
|
||||||
multipleDatesSeparator: ',',
|
multipleDatesSeparator: ',',
|
||||||
|
|
||||||
// navigation
|
// navigation
|
||||||
@ -222,6 +221,7 @@ var Datepicker;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.opts.multipleDates) {
|
if (this.opts.multipleDates) {
|
||||||
|
if (this.selectedDates.length === this.opts.multipleDates) return;
|
||||||
if (!this._isSelected(date)) {
|
if (!this._isSelected(date)) {
|
||||||
this.selectedDates.push(date);
|
this.selectedDates.push(date);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user