You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Strangely, it first converts the value to string and then parses its value. The Payload generated types use string for dates. In order to be compliant the Date type should be changed to string in the validation function definition.
For future releases it would be better to use Date values.
I think for now on our side we think dates should remain as strings instead of them being cast to Date. When returned via the REST API for example it would always return a string regardless.
I also think that as a UTC string it's gonna be easier for people to handle any conversions as needed since Date is always localised to the system/user locale.
Since we haven’t heard back in a while and this issue relates to several releases ago, we’re going to close it for now. If you’re still seeing this behavior on the latest version, please open a new issue with updated reproduction steps and environment details so we can investigate.
Activity
paulpopus commentedon Feb 6, 2025
I think for now on our side we think dates should remain as strings instead of them being cast to
Date. When returned via the REST API for example it would always return a string regardless.I also think that as a UTC string it's gonna be easier for people to handle any conversions as needed since Date is always localised to the system/user locale.
cbratschi commentedon Feb 6, 2025
@paulpopus Please reopen, I am fine with the string as type but Payload defines the type currently as Date and not string. This is the confusion.
paulpopus commentedon Feb 6, 2025
Ohh I see, re-opening then so we can revisit and confirm our types
JessRynkar commentedon Jan 19, 2026
Hi! Are you still experiencing this on the latest version
v3.72.0? Some work improvements were made to date fields last year.JessRynkar commentedon Feb 2, 2026
Since we haven’t heard back in a while and this issue relates to several releases ago, we’re going to close it for now. If you’re still seeing this behavior on the latest version, please open a new issue with updated reproduction steps and environment details so we can investigate.
cbratschi commentedon Feb 2, 2026
This issue is still there.
Here it is marked as Date:
https://github.com/payloadcms/payload/blob/main/packages/payload/src/fields/validations.ts#L395
And the workaround is still here:
https://github.com/payloadcms/payload/blob/main/packages/payload/src/fields/validations.ts#L401
fix: resolve six request, validation and developer tooling reports
fix: address 24 Payload read, schema, version and tooling reports (#9)