From: Marcel Werk Date: Mon, 12 Dec 2016 16:52:55 +0000 (+0100) Subject: Fixed min-date validation in date-picker X-Git-Tag: 3.0.0_RC_1~28 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=43cfe8d86f2b7544a22c4f93e3717ac542153def;p=GitHub%2FWoltLab%2FWCF.git Fixed min-date validation in date-picker --- 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; }