From a9c876db7c30d500ed74d1cc910d9da8c4dfa08e Mon Sep 17 00:00:00 2001 From: Giga Date: Thu, 16 Apr 2020 22:46:53 +0400 Subject: [PATCH] fix infinite loop if start is `Invalid Date` then start.getDay() is `Nan`, so code gets stuck on infinite loop. --- jquery.datetimepicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.datetimepicker.js b/jquery.datetimepicker.js index 313ae97..f1b938f 100644 --- a/jquery.datetimepicker.js +++ b/jquery.datetimepicker.js @@ -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(); }