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

fix: Date is not validated as expected #2355

Open
sagepoudel opened this issue Jan 12, 2024 · 3 comments
Open

fix: Date is not validated as expected #2355

sagepoudel opened this issue Jan 12, 2024 · 3 comments
Labels

Comments

@sagepoudel
Copy link

The date is validated when the date is clearly not valid. You can put hyphen in the beginning of a date and it is treated as the right format.

Expected behavior

"-2012" not valid

Actual behavior

"-2012" valid

@jithesh-poojari
Copy link

image
Working fine. Right?

@sagepoudel
Copy link
Author

not really, was there a fix?

@Sumit-tech-joshi
Copy link
Contributor

@sagepoudel I created a pull request for the fix #2381

Screenshot 2024-03-23 at 6 23 53 PM Screenshot 2024-03-23 at 6 20 27 PM

This is the validation i added
// Check if the year starts with a hyphen
if (fullYear.startsWith('-')) {
return false; // Hyphen before year is not allowed
}

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

No branches or pull requests

3 participants