From c693c4dfc2ce8eefea68bf390ca3875fe49d9fe0 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 1 Nov 2016 10:30:36 +0100 Subject: [PATCH] Added support for another date grid row --- .../files/js/WoltLabSuite/Core/Date/Picker.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js index a2cd93ea66..3143b07143 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js @@ -384,8 +384,18 @@ define(['DateUtil', 'Language', 'ObjectMap', 'Dom/ChangeListener', 'Ui/Alignment date.setDate(date.getDate() - 1); } + // show the last row + elShow(_dateCells[35].parentNode); + var selectable; - for (i = 0; i < 35; i++) { + for (i = 0; i < 42; i++) { + if (i === 35 && date.getMonth() !== month) { + // skip the last row if it only contains the next month + elHide(_dateCells[35].parentNode); + + break; + } + cell = _dateCells[i]; cell.textContent = date.getDate(); @@ -559,7 +569,7 @@ define(['DateUtil', 'Language', 'ObjectMap', 'Dom/ChangeListener', 'Ui/Alignment // create date grid var callbackClick = this._click.bind(this), cell, row; - for (i = 0; i < 5; i++) { + for (i = 0; i < 6; i++) { row = elCreate('li'); _dateGrid.appendChild(row); -- 2.20.1