Merge pull request #213 from obxpete/master

Added minDateTime option
This commit is contained in:
Valeriy 2014-12-11 03:16:46 +00:00
commit a80fc2d845

View File

@ -1402,9 +1402,11 @@
h = parseInt(now.getHours(), 10);
now.setMinutes(m);
m = parseInt(now.getMinutes(), 10);
var optionDateTime = new Date(_xdsoft_datetime.currentTime)
optionDateTime.setHours(h);
optionDateTime.setMinutes(m);
classes = [];
if ((options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) {
if((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) {
classes.push('xdsoft_disabled');
}
if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && parseInt(_xdsoft_datetime.currentTime.getHours(), 10) === parseInt(h, 10) && (options.step > 59 || Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step === parseInt(m, 10))) {