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

isDate raise an exception on "2024-08-" #2427

Closed
vit1251 opened this issue Jun 25, 2024 · 6 comments
Closed

isDate raise an exception on "2024-08-" #2427

vit1251 opened this issue Jun 25, 2024 · 6 comments

Comments

@vit1251
Copy link

vit1251 commented Jun 25, 2024

Describe the bug

isDate raise an exception on "2024-"
isDate raise an exception on "2024-08-"

Validation error: err = TypeError: Cannot read properties of undefined (reading 'length')

Additional context
Validator.js version: 13.12.0
Node.js version: 20.14.0
OS platform: linux

@TDKhang
Copy link

TDKhang commented Aug 23, 2024

With format = "YYYY-MM-DD", I also get the error when input is "2024", but "202" works fine

@profnandaa
Copy link
Member

PR welcome.

@pano9000
Copy link
Contributor

pano9000 commented Aug 25, 2024

can confirm error is thrown with the following

2024
2024-08

these correctly return false however

2024-
2024-08-
2024-08-09-

edit: error got introduced with #2257

I'll try to take a look and (hopfeully fix :-)) at this tomorrow

@pano9000 pano9000 self-assigned this Aug 25, 2024
@pano9000
Copy link
Contributor

@profnandaa fix PR is ready, kindly approve and merge :-)

@pano9000
Copy link
Contributor

fixed with ff56dcf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants