Skip to content

Commit

Permalink
update dev
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpopus committed Apr 6, 2024
1 parent fb71d36 commit 079b1b2
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
41 changes: 41 additions & 0 deletions dev/src/collections/DateExample.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { CollectionConfig } from 'payload/types'
import { DateField } from '../../../src'

const DateExamples: CollectionConfig = {
slug: 'dateExamples',
admin: {
useAsTitle: 'title',
},
fields: [
{
name: 'title',
type: 'text',
},
{
type: 'date',
name: 'defaultDate',
admin: {
description: 'Default date field behaviour',
date: {
pickerAppearance: 'dayAndTime',
},
},
},
{
type: 'row',
fields: [
...DateField({
name: 'date',
admin: {
description: 'You can choose a timezone',
date: {
pickerAppearance: 'dayAndTime',
},
},
}),
],
},
],
}

export default DateExamples
2 changes: 2 additions & 0 deletions dev/src/payload.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import RangeExamples from './collections/RangeExamples'
import TelephoneExamples from './collections/TelephoneExamples'
import AlertBoxExamples from './collections/AlertBoxExamples'
import ColourPickerExamples from './collections/ColourPickerExamples'
import DateExamples from './collections/DateExample'

export default buildConfig({
serverURL: process.env.SERVER_URL,
Expand Down Expand Up @@ -50,6 +51,7 @@ export default buildConfig({
TelephoneExamples,
ColourPickerExamples,
Users,
DateExamples,
],
typescript: {
outputFile: path.resolve(__dirname, 'payload-types.ts'),
Expand Down

0 comments on commit 079b1b2

Please sign in to comment.