Added opposite of minTime and maxTime, disabledMinTime and disabledMaxTime

Added 2 new properties, to make a period of time disabled by setting disabledMinTime and disabledMaxTime.

I needed a way, to have minTime and maxTime set, but also a specific period of time within minTime and maxTime to be disabled. This can now be set with disabledMinTime and disabledMaxTime.

Example:

minTime: 12:00
maxTime: 22:00

disabledMinTime: 13:00
disabledMaxTime: 20:00

Then the available time will be 12:00 - 13:00 and 20:00 - 22:00
This commit is contained in:
Daniel 2015-06-22 12:49:40 +02:00
parent 26fd11d74f
commit d6cefe6a61

View File

@ -460,6 +460,8 @@
maxDate: false,
minTime: false,
maxTime: false,
disabledMinTime: false,
disabledMaxTime: false,
allowTimes: [],
opened: false,
@ -1568,6 +1570,9 @@
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.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) {
classes.push('xdsoft_disabled');
}
current_time = new Date(_xdsoft_datetime.currentTime);
current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10));