Added minDateTime option for people who want to limit users to both a date and a time minimum.

This commit is contained in:
pete 2014-12-10 11:44:12 -05:00
parent 94263f6b22
commit e7f38dc52a

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))) {