ISO8601 rule (v2)
Validate user input against ISO 8601 Format.
Usage
bootstrapValidate('#input', 'ISO8601:Your input does not match the wanted format YYYY-MM-DD')Options
This rule only needs an error message after the rule name, for example ISO8601:Your input does not match the wanted format YYYY-MM-DD.
Live Example
Checking...
Source
/** * @since v2.1.0 * @error Your input does not match the wanted format YYYY-MM-DD * @description Validate user input against ISO 8601 Format. */export default function ISO8601(input: RuleInput) { return /^\d{4}-([0]\d|1[0-2])-([0-2]\d|3[01])$/.test(input.value);}