Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Years in dropdown should include current year #1909

Open
wants to merge 1 commit into
base: master
from

Conversation

@robertfwest
Copy link

commented Sep 11, 2019

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.

@codecov

This comment has been minimized.

Copy link

commented Sep 11, 2019

Codecov Report

Merging #1909 into master will decrease coverage by 0.17%.
The diff coverage is 71.42%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/year_dropdown.jsx 90.47% <71.42%> (-4.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e05355a...9378105. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.