mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
Added disableWeekDays property.
Added this property to disable weekdays from an array of integers containing numbers 1-7.
This commit is contained in:
parent
39d8f7c9a0
commit
5613208dd1
@ -511,6 +511,7 @@
|
||||
highlightedDates: [],
|
||||
highlightedPeriods: [],
|
||||
disabledDates : [],
|
||||
disabledWeekDays: [],
|
||||
yearOffset: 0,
|
||||
beforeShowDay: null,
|
||||
|
||||
@ -943,6 +944,10 @@
|
||||
options.disabledDates = $.extend(true, [], _options.disabledDates);
|
||||
}
|
||||
|
||||
if (_options.disabledWeekDays && $.isArray(_options.disabledWeekDays) && _options.disabledWeekDays.length) {
|
||||
options.disabledWeekDays = $.extend(true, [], _options.disabledWeekDays);
|
||||
}
|
||||
|
||||
if ((options.open || options.opened) && (!options.inline)) {
|
||||
input.trigger('open.xdsoft');
|
||||
}
|
||||
@ -1423,6 +1428,7 @@
|
||||
maxDate = false,
|
||||
minDate = false,
|
||||
hDate,
|
||||
day,
|
||||
d,
|
||||
y,
|
||||
m,
|
||||
@ -1466,6 +1472,7 @@
|
||||
classes = [];
|
||||
i += 1;
|
||||
|
||||
day = start.getDay();
|
||||
d = start.getDate();
|
||||
y = start.getFullYear();
|
||||
m = start.getMonth();
|
||||
@ -1484,6 +1491,8 @@
|
||||
classes.push('xdsoft_disabled');
|
||||
} else if (options.disabledDates.indexOf(start.dateFormat(options.formatDate)) !== -1) {
|
||||
classes.push('xdsoft_disabled');
|
||||
} else if (options.disabledWeekDays.indexOf(day) !== -1) {
|
||||
classes.push('xdsoft_disabled');
|
||||
}
|
||||
|
||||
if (customDateSettings && customDateSettings[1] !== "") {
|
||||
|
Loading…
Reference in New Issue
Block a user