typestack / class-validator

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

feature: A parameter for isDateString #2231

Open yanmarinich opened 1 year ago

yanmarinich commented 1 year ago

Description

The problem is ORM level like prisma which has DateTime type so string like 2023-09-25 is valid for class-validator but invalid for Prisma which leads to exception "Invalid value for argument startsAt: premature end of input. Expected ISO-8601 DateTime."

Proposed solution

Add an extra parameter something like isDateTime which checks if a string has time.

recallwei commented 12 months ago

Face the same problem.