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

Use dayPickerProps controlled month before value. #612

Merged
merged 4 commits into from
Mar 5, 2018
Merged

Use dayPickerProps controlled month before value. #612

merged 4 commits into from
Mar 5, 2018

Conversation

kradical
Copy link
Contributor

@kradical kradical commented Jan 22, 2018

Hello @gpbl !

First thank you for your time commitment to this project, it is very useful!

This change is a re-ordering of how the current month is calculated from props. I believe it should use the controlled month from dayPickerProps.month before it uses the current value.

My specific use case is a 4-month calendar using the DayPickerInput date range selection with a from/to input. In my case I want the first month in the 4 month range to show the start of the range but it will default to using the current value. Which on the to DayPickerInput will possibly be a different month.

Otherwise I don't think there is a way to use DayPickerInput as a controlled component (w/ redux-form for us) and control the month through props.

Let me know if there is anything else I can provide to make this easier!

@codecov
Copy link

codecov bot commented Jan 22, 2018

Codecov Report

Merging #612 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #612   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          15     15           
  Lines         621    619    -2     
  Branches      133    132    -1     
=====================================
- Hits          621    619    -2
Impacted Files Coverage Δ
src/DayPickerInput.js 100% <100%> (ø) ⬆️

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 3156e3d...34c8d1a. Read the comment docs.

@gpbl
Copy link
Owner

gpbl commented Feb 23, 2018

Thanks @kradical I'd review this soon :) Just catching up with the older stuff .

@gpbl gpbl merged commit 3312f22 into gpbl:master Mar 5, 2018
@gpbl gpbl added the v:patch label Mar 5, 2018
@gpbl gpbl added this to the v7.1.0 milestone Mar 5, 2018
@gpbl
Copy link
Owner

gpbl commented Mar 5, 2018

Published as v7.1.0.

@kradical
Copy link
Contributor Author

kradical commented Mar 5, 2018

awesome! Thank you!

kimamula pushed a commit to kimamula/react-day-picker that referenced this pull request Aug 17, 2022
Use dayPickerProps controlled month before value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants