Files
payload/test/localization/collections/LocalizedDateFields/index.ts
Paul c43891b2ba fix(db-mongodb): localized dates being returned as date objects instead of strings (#12354)
Fixes https://github.com/payloadcms/payload/issues/12334

We weren't passing locale through to the Date transformer function so
localized dates were being read as objects instead of strings.
2025-05-10 17:15:15 -07:00

22 lines
390 B
TypeScript

import type { CollectionConfig } from 'payload'
import { localizedDateFieldsSlug } from '../../shared.js'
export const LocalizedDateFields: CollectionConfig = {
slug: localizedDateFieldsSlug,
versions: {
drafts: true,
},
fields: [
{
type: 'date',
name: 'localizedDate',
localized: true,
},
{
type: 'date',
name: 'date',
},
],
}