mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
Added minDateTime option for people who want to limit users to both a date and a time minimum.
This commit is contained in:
parent
94263f6b22
commit
e7f38dc52a
@ -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))) {
|
||||
|
Loading…
Reference in New Issue
Block a user