From 43cfe8d86f2b7544a22c4f93e3717ac542153def Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 12 Dec 2016 17:52:55 +0100 Subject: [PATCH] Fixed min-date validation in date-picker --- wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js index 3143b07143..24ded4cb1b 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js @@ -388,6 +388,7 @@ define(['DateUtil', 'Language', 'ObjectMap', 'Dom/ChangeListener', 'Ui/Alignment elShow(_dateCells[35].parentNode); var selectable; + var comparableMinDate = new Date(_minDate.getFullYear(), _minDate.getMonth(), _minDate.getDate()); for (i = 0; i < 42; i++) { if (i === 35 && date.getMonth() !== month) { // skip the last row if it only contains the next month @@ -401,7 +402,7 @@ define(['DateUtil', 'Language', 'ObjectMap', 'Dom/ChangeListener', 'Ui/Alignment cell.textContent = date.getDate(); selectable = (date.getMonth() === month); if (selectable) { - if (date < _minDate) selectable = false; + if (date < comparableMinDate) selectable = false; else if (date > _maxDate) selectable = false; } -- 2.20.1