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.
22 lines
390 B
TypeScript
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',
|
|
},
|
|
],
|
|
}
|