-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[DatePicker] Enabling setting a month/date that the picker opens on #4900
Comments
I agree this would be a nice feature. The current work around is setting the |
@mpontikes I need the default field value to be empty. Also I'm using a controlled input. This is used in a search form which should allow no date input filled. |
This is a problem for me as well. else if (props.defaultValue) {
return props.defaultValue;
} |
Has anyone found a solution to this? |
One way to do that with the current implementation is to keep a ref to the date picker component and call setState directly on it, which is ugly and will certainly break some day but it works for now. Something like this: <DatePicker
ref={(c) => this.picker = c}
minDate={minDate}
onShow={() => {
if (this.picker.state.date === undefined)
this.picker.setState({dialogDate: minDate})
}
}
/> It would be much better if the default dialog date was the min date when one is provided. |
Hello, same problem here.. Thank you |
Closing for #4787 |
If I understand the documentation well, as for now there is no way to force the date picker to open on specific month/date. This would be really great. If I set a
minDate
in the future, the user has to click a lot to move to the month with dates that are enabled to be selected.Also I think that It would be more user-friendly if the DatePicker's default month would be the month of the
minDate
, if it's present of course.The text was updated successfully, but these errors were encountered: