typestack / class-validator

Decorator-based property validation for classes.
MIT License
11.03k stars 800 forks source link

fix: @IsDateString() accepts wrong date format #2361

Closed sagepoudel closed 10 months ago

sagepoudel commented 10 months ago

Description

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



### Expected behavior
"-2012" not valid

### Actual behavior
"-2012" valid
braaar commented 10 months ago

class-validator uses validatorjs internally for validation. This issue should be raised in there as we wouldn't fix something like this in here.

github-actions[bot] commented 9 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.