parameter icon indicating copy to clipboard operation
parameter copied to clipboard

Allowing ISO format for dateTime validation?

Open BkunS opened this issue 6 years ago • 1 comments

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

BkunS avatar Mar 18 '19 03:03 BkunS

@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';
    }
  });

jasine avatar Apr 09 '19 14:04 jasine