Closed NormandoHall closed 10 months ago
Hi @NormandoHall, thanks for reaching out!
I just checked both examples that you supplied, and they both seem to be passing:
On the right hand side you're seeing the proxy Object being returned from enforce, instead of an error being thrown - which means that isDate does indeed pass.
I am wondering how it looks inside your suite, there may be something else at play. Do you have a quick repro sandbox that I can take a look at?
Hi @ealush, Thanks for your quick reply.
I have forked your svelte example sandbox, and added the form field "birthDate" and added the test in the suite, and still fails.
https://codesandbox.io/p/sandbox/svelte-vest-5-isdate-fail-vtdzjw
@NormandoHall No changes to your code whatsoever, it seems to work correctly.
Can you try just inputting this:
01/08/1990
I am wondering if it's related to trimming, special ascii characters, or something else I can't think of - because your code works.
See screencap
It is very strange. I tested 01/08/1990
and fails. Tested with Chrome, Edge, and Firefox
https://github.com/ealush/vest/assets/2943127/9bd40c8c-ebcf-455c-bd28-6e3eb248bfed
Well, with vest@5.1.0
runs ok (maybe because uses validator@13.9.0
)
OK. I think you are right. I had the 13.9.0 locally installed and that's why I did not experience this. I downgraded and now I see this.
Releasing now a patch version of Vest with the lower validator version. Will be out in a few moments.
@ealush, now runs like a charm.
Thank you!
Fail:
No fails:
Node: v18.18 Vest: 5.2.3
The same happens importing external rules from
validator
or using built in plugins.EDIT: Seems an issue with
validator
?https://github.com/validatorjs/validator.js/issues/2256
EDIT2:
Yes, there is an issue with
validator
. A quick and dirty workaround for me is parsing withdayjs
and convert to Date object. No fails with the format, but not validates de date.