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

Can not validate DatetimePickerTrigger using MomentJS #77

Closed
nhatquan160697 opened this issue Apr 17, 2019 · 1 comment
Closed

Can not validate DatetimePickerTrigger using MomentJS #77

nhatquan160697 opened this issue Apr 17, 2019 · 1 comment
Assignees

Comments

@nhatquan160697
Copy link

Hi, I have a problem to ask you:

I'm trying to validate Datetime picker using MomentJS but I don't know how does it work.

This is my code:
<DatetimePickerTrigger moment={this.state.moment} onChange={this.handleChange}> <input type="text" className="style-field-date" value={this.state.moment.format('YYYY-MM-DD HH:mm')} readOnly /> </DatetimePickerTrigger>

I tried { this.validator.message('date', this.state.moment && moment(this.state.moment, 'DD-MM-YYYY'), 'after:date') } but it didn't work.
Please help me validate this field.
Thanks you

@stuyam
Copy link
Collaborator

stuyam commented Apr 17, 2019

Does it seem to be related to this issue #66 ? Do you get the message "Date validators require using momentjs https://momentjs.com and moment objects." in your console when you try to run it?

@stuyam stuyam self-assigned this Apr 17, 2019
@stuyam stuyam closed this as completed May 20, 2019
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