-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Localized date field returns wrong type #12334
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
Comments
🚀 This is included in version v3.38.0 |
This issue has been automatically locked. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the Bug
I’ve encountered a bug with localized date fields. Instead of returning a string - they return a Date object. This behavior causes a runtime error in my project, where a string is required.
Link to the code that reproduces this issue
https://github.com/MarvinVrdoljak/payload-bug-report-2
Reproduction Steps
The Pages collection is located at:
/home/marvin/websites/payload-bug-report-2/src/collections/Pages/index.ts
It contains two new date fields: one localized, one not.
In the frontend rendering file at:
/home/marvin/websites/payload-bug-report-2/src/app/(frontend)/[slug]/page.tsx
you’ll find a console.log showing the incorrect output of the localized field.
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
The text was updated successfully, but these errors were encountered: