How to: date_format and decimals for V3? #3256
Unanswered
lucianobosco
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You can use import { parse, isValid } from 'date-fns';
import { extend } from 'vee-validate';
extend('date_format', (value, [format]) => {
const parsed = parse(value, format, new Date());
return isValid(parsed);
}); You can copy the source code for decimals from v2 and use it in v3 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Does someone have an example for how to validate date_format and decimals in V3?
I'm not able to understand or even find a sample code in order to validate dates and decimals.
I think this will be very helpful for a lot of people since in most cases we have a date field in forms.
What was really simple in V2 now is a headache :'(
I've read that samples will be added, but I didn't find them yet: #2247 (comment)
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions