Cannot indicate which month is visible on open
See original GitHub issueIdeally this should be a controlled prop that would default to the current month. That way you can close the <DayPicker />
and reopen to where you were previously
My vision is that this would be a currentMonth
prop on the SingleDatePicker
and on the DateRangePicker
that would take in a moment object. If a parent component wanted to keep track of this in the state then, they could do so using the onPrevMonthClick
and onNextMonthClick
callbacks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:26 (16 by maintainers)
Top Results From Across the Web
How to Fix Excel Dates That Won't Change Format - Contextures
In the drop down list, click on the date format that your dates are currently displayed in. In this example, the dates are...
Read more >View your day, week, or month - Google Calendar Help
On your computer, open Google Calendar. In the top right, choose a view: Day, Week, Month, Year, Schedule, or 4 days. ... Show...
Read more >Check and update your calendar on Apple Watch
Open the Calendar app on your Apple Watch, or tap the date or a calendar event on ... Show the current month: While...
Read more >Change how you view your Outlook calendar - Microsoft Support
Keep upcoming calendar items visible. Keep your upcoming appointments and meetings ... Change to Month view with a Monday start date and show...
Read more >Fetal Pole: Ultrasound, Anatomy & Function - Cleveland Clinic
Whether there's a pregnancy complication: If the fetal pole is unexpectedly small or not seen, it may indicate incorrect dates or a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think that the fine tuned control of this prop allows for behavior like:
I think that while in a lot of cases, it makes sense to open to the start date month, we want to be able to cover all options easily, especially those cases where no date has been selected.
On Fri, Aug 19, 2016, 10:29 AM jcreamer898 notifications@github.com wrote:
@sag1v You can access to the currentMoment state (moment object) in your parent component by adding a ref to the date component
this.dayPicker.state.currentMonth
Day picker implementation with ref and prev/next callbacks.
But at this moment, currentMonth hasn’t yet been updated (+/- 1 month) because the callback method is called before updating the state value.
@majapw Is there a better way to get this value without adding or removing 1 month manually like I did ?
callback method call (called before state update) DayPicker.jsx#L543 and finally, the state update of currentMonth DayPicker.jsx#L567