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: [], highlightedDates: [],
highlightedPeriods: [], highlightedPeriods: [],
disabledDates : [], disabledDates : [],
disabledWeekDays: [],
yearOffset: 0, yearOffset: 0,
beforeShowDay: null, beforeShowDay: null,
@ -942,6 +943,10 @@
if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) { if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) {
options.disabledDates = $.extend(true, [], _options.disabledDates); 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)) { if ((options.open || options.opened) && (!options.inline)) {
input.trigger('open.xdsoft'); input.trigger('open.xdsoft');
@ -1423,6 +1428,7 @@
maxDate = false, maxDate = false,
minDate = false, minDate = false,
hDate, hDate,
day,
d, d,
y, y,
m, m,
@ -1466,6 +1472,7 @@
classes = []; classes = [];
i += 1; i += 1;
day = start.getDay();
d = start.getDate(); d = start.getDate();
y = start.getFullYear(); y = start.getFullYear();
m = start.getMonth(); m = start.getMonth();
@ -1484,6 +1491,8 @@
classes.push('xdsoft_disabled'); classes.push('xdsoft_disabled');
} else if (options.disabledDates.indexOf(start.dateFormat(options.formatDate)) !== -1) { } else if (options.disabledDates.indexOf(start.dateFormat(options.formatDate)) !== -1) {
classes.push('xdsoft_disabled'); classes.push('xdsoft_disabled');
} else if (options.disabledWeekDays.indexOf(day) !== -1) {
classes.push('xdsoft_disabled');
} }
if (customDateSettings && customDateSettings[1] !== "") { if (customDateSettings && customDateSettings[1] !== "") {