Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Years in dropdown should include current year #1909
If the current year is less than the minDate's, the current year (and any years between the two) was not an option in the dropdown. This caused the minDate's year to be the currently selected option even though the calendar was still showing the current year. So, the only way to navigate to the minDate was to select a year after and then back (or by hitting the next month chevron multiple times).
This is easier to see than explain. To see the problem, add 'showYearDropdown dropdownMode="select"' to the two DatePicker's in dateRange.js. Then, use the year dropdown to change the start date to a year later. Then, open the end date picker. Notice that the calendar is still showing the original end date. The dropdown has 2015 selected. Dropdown and try to re-select 2015--nothing happens.
With my change, the end date picker's dropdown still has 2014 selected. So, the user can select 2015 which will cause the calendar to update. It will also cause the dropdown to remove the 2014 option. That last bit may seem a bit strange, but it is consistent with the previous month chevron not appearing even when you navigate to the next month until you are past the minDate's month.
@@ Coverage Diff @@ ## master #1909 +/- ## ========================================== - Coverage 94.86% 94.69% -0.18% ========================================== Files 17 17 Lines 1012 1017 +5 Branches 242 243 +1 ========================================== + Hits 960 963 +3 - Misses 9 10 +1 - Partials 43 44 +1