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

Allowing ISO format for dateTime validation? #62

Open
BkunS opened this issue Mar 18, 2019 · 1 comment
Open

Allowing ISO format for dateTime validation? #62

BkunS opened this issue Mar 18, 2019 · 1 comment

Comments

@BkunS
Copy link

BkunS commented Mar 18, 2019

Is it possible to add ISO format support in validation rules of type dateTime?

@jasine
Copy link

jasine commented Apr 9, 2019

@BkunS you can use moment and add custom validate

validator.addRule('ISOTime', (_, value) => {
    if (!moment(value, moment.ISO_8601).isValid()) {
      return 'time must be UTC ISO8601 format';
    }
  });

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