mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
Allow maxDate in past or minDate in future
Beforehand the maxDate was only allowed to be the current date (+1970/01/01) or a date in the future (e.g. +1970/01/10). You couldn't set the maxDate to yesterday (e.g. -1970/01/02) or earlier in a logical manner. All the functionality is in there, just needed the regex opened up to check for a plus or a minus at the start of the maxDate and minDate variables and parse them if present.
This commit is contained in:
parent
72ff0b43e5
commit
1b9d58d2b7
@ -1026,11 +1026,11 @@
|
||||
timeboxparent.xdsoftScroller('hide');
|
||||
}
|
||||
|
||||
if (options.minDate && /^-(.*)$/.test(options.minDate)) {
|
||||
if (options.minDate && /^[\+\-](.*)$/.test(options.minDate)) {
|
||||
options.minDate = _xdsoft_datetime.strToDateTime(options.minDate).dateFormat(options.formatDate);
|
||||
}
|
||||
|
||||
if (options.maxDate && /^\+(.*)$/.test(options.maxDate)) {
|
||||
if (options.maxDate && /^[\+\-](.*)$/.test(options.maxDate)) {
|
||||
options.maxDate = _xdsoft_datetime.strToDateTime(options.maxDate).dateFormat(options.formatDate);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user