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

[FormsyDate] defaultDate is not valid for required #29

Closed
quangrau opened this issue Nov 16, 2015 · 3 comments
Closed

[FormsyDate] defaultDate is not valid for required #29

quangrau opened this issue Nov 16, 2015 · 3 comments

Comments

@quangrau
Copy link

Hi everyone,

Here my component, I try to set defaultDate is minDate but the form is still invalid cause the value of start_date_time still null until I make a change on this. Have you had any idea for this?

<FormsyDate
        required
        fullWidth
        disableYearSelection
        minDate={minDate}
        defaultDate={minDate}
        formatDate={this.handleFormatDate}
        name="start_date_time"
        floatingLabelText="Start date" />```
@mbrookes
Copy link
Collaborator

I suspect this is probably similar to #21. I'll take a look.

@mbrookes
Copy link
Collaborator

Try value instead of defaultDate. Formsy expects the default to be in 'value' prop, and it so happens DatePicker also supports this prop; so unlike FormsyText, there was no need to change FormsyDate to internally map value to defaultDate.

@mbrookes
Copy link
Collaborator

Tested and confirmed working as described.

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

No branches or pull requests

2 participants