Added disabledDates options

This commit is contained in:
Valeriy 2014-10-23 17:35:13 +06:00
parent ee7047e204
commit f49674765a
2 changed files with 10 additions and 2 deletions

View File

@ -63,7 +63,8 @@ window.onerror = function(errorMsg) {
}*/
$('#datetimepicker').datetimepicker({
dayOfWeekStart : 1,
lang:'ru',
lang:'en',
disabledDates:['1986/01/08','1986/01/09','1986/01/10'],
startDate: '1986/01/05'
});
$('#datetimepicker').datetimepicker({value:'2015/04/15 05:03',step:10});

View File

@ -302,6 +302,7 @@
roundTime: 'round', // ceil, floor
className: '',
weekends: [],
disabledDates : [],
yearOffset: 0,
beforeShowDay: null
};
@ -622,7 +623,11 @@
if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) {
options.weekends = $.extend(true, [], _options.weekends);
}
if( _options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length ){
options.disabledDates = $.extend(true,[],_options.disabledDates);
}
if ((options.open || options.opened) && (!options.inline)) {
input.trigger('open.xdsoft');
}
@ -1146,6 +1151,8 @@
if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
classes.push('xdsoft_disabled');
} else if (options.disabledDates.indexOf(start.dateFormat(options.formatDate)) !== -1) {
classes.push('xdsoft_disabled');
}
if (customDateSettings && customDateSettings[1] !== "") {