fix infinite loop

if start is `Invalid Date` then start.getDay() is `Nan`, so code gets stuck on infinite loop.
This commit is contained in:
Giga 2020-04-16 22:46:53 +04:00 committed by GitHub
parent cda4cbc903
commit a9c876db7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1667,7 +1667,7 @@ var datetimepickerFactory = function ($) {
clearTimeout(xchangeTimer);
xchangeTimer = setTimeout(function () {
if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null || isNaN(_xdsoft_datetime.currentTime.getTime())) {
_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
}