-
Notifications
You must be signed in to change notification settings - Fork 393
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
Dynamic change default date for Calendar #990
Comments
These props are controlled which means that if you use |
Thanks for your help, after some trial and error I could make it work, but I feel that some clarification is needed in the docs about this subject, there is just a brief description of the |
There is a whole page on it here: http://jquense.github.io/react-widgets/controllables/ and each controllable prop notes that it is controllable like this: maybe each should also have a link to the controlled page? |
I don't know how I missed that page, maybe I was a bit obfuscated. But a link to it whenever a controlled property is documented would be fine and would help some folks like me. Anyway thanks for that great piece of software. |
I'm trying to dinamically change the default date a calendar opens at in a
DateTimePicker
based on the value of other one.If the first
DateTimePicker
changes its value and the secondDateTimePicker
is null then the secondDateTimePicker
must have the value of the first as a default value for opening the calendar. For example if 2020-01-01 is set in the first input and the second is null, when opening the calendar for the second input the month displayed must be January.First try:
This does not update the
currentDate
property whenever thedefaultCurrentDate
property changes. The calendar always opens in todays month.Second try:
This works, and when the input is empty the default current date is updated and the calendar opens in the correct month passed to
currentDate
property. But then the calendar is unable to change the month. Whenever the user clicks in the calendar's before or after month buttons theonCurrentDateChange
is triggered with the correct value, but the calendar does not change the month view to move to the correct month. You can only select a day in the visible month. Inspecting the control with React developer tools confirms that the innercurrentDate
property is not changed at all.I have read this very old issue that seems fixed: #593, and also this but did not offer any solution for me: #733. This very very old one also seems related, but there is no clear solution proposed that I could understand: #32.
What is the correct way to dinalically set an empty
DateTimePicker
default date for the calendar?The text was updated successfully, but these errors were encountered: