Added disableWeekDays property.

Added this property to disable weekdays from an array of integers containing numbers 1-7.
This commit is contained in:
Daniel 2015-06-17 17:14:31 +02:00
parent 39d8f7c9a0
commit 5613208dd1

View File

@ -511,6 +511,7 @@
highlightedDates: [],
highlightedPeriods: [],
disabledDates : [],
disabledWeekDays: [],
yearOffset: 0,
beforeShowDay: null,
@ -942,6 +943,10 @@
if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) {
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] !== "") {