Added support for another date grid row
authorAlexander Ebert <ebert@woltlab.com>
Tue, 1 Nov 2016 09:30:36 +0000 (10:30 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 1 Nov 2016 09:30:36 +0000 (10:30 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js

index a2cd93ea66a01c296667ecda2627c7ad78794ecd..3143b0714301b5b19fc33149a20c8a724ea78a6e 100644 (file)
@@ -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);