mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
Added disabledDates options
This commit is contained in:
parent
ee7047e204
commit
f49674765a
@ -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});
|
||||
|
@ -302,6 +302,7 @@
|
||||
roundTime: 'round', // ceil, floor
|
||||
className: '',
|
||||
weekends: [],
|
||||
disabledDates : [],
|
||||
yearOffset: 0,
|
||||
beforeShowDay: null
|
||||
};
|
||||
@ -623,6 +624,10 @@
|
||||
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] !== "") {
|
||||
|
Loading…
Reference in New Issue
Block a user