Skip to content

Commit 572be7f

Browse files
committed
update readme
1 parent 079b1b2 commit 572be7f

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ All fields have had changes to standardise how the field parameters are structur
3535
- [Telephone field](#telephone-field)
3636
- [Alert Box field](#alert-box-field)
3737
- [Colour Picker field](#colour-picker-field)
38+
- [Date field](#date-field)
3839

3940
## Styling
4041

@@ -562,6 +563,56 @@ The `ColourPickerField` accepts the following parameters
562563

563564
- `showPreview` - optional boolean
564565

566+
## Date field
567+
568+
[source](https://github.com/NouanceLabs/payload-better-fields-plugin/tree/master/src/fields/Date)
569+
570+
The goal of this field is to help with management of timezones.
571+
572+
### Usage
573+
574+
```ts
575+
import { CollectionConfig } from 'payload/types'
576+
import { DateField } from '@nouance/payload-better-fields-plugin'
577+
578+
const Examples: CollectionConfig = {
579+
slug: 'examples',
580+
admin: {
581+
useAsTitle: 'title',
582+
},
583+
fields: [
584+
{
585+
name: 'title',
586+
type: 'text',
587+
},
588+
...DateField({
589+
name: 'date',
590+
admin: {
591+
date: {
592+
pickerAppearance: 'dayAndTime',
593+
},
594+
},
595+
}),
596+
],
597+
}
598+
599+
export default Examples
600+
```
601+
602+
### Options
603+
604+
The `DateField` accepts the following parameters
605+
606+
- `overrides` - `DateField` **required** for `name` attribute
607+
608+
- `timezone` - `Timezone` optional
609+
610+
- `enabled` - defaults to `true`
611+
612+
- `timezones` - optional list of timezones to customise available options
613+
614+
- `overrides` - `SelectField` **required** for `name` attribute
615+
565616
## Contributing
566617

567618
For development purposes, there is a full working example of how this plugin might be used in the [dev](./dev) directory of this repo.
@@ -576,6 +627,7 @@ git clone [email protected]:NouanceLabs/payload-better-fields-plugin.git \
576627
```
577628

578629
## Contributors
630+
579631
Thanks to the following people for contributing code to this plugin
580632

581633
[MarkAtOmniux](https://github.com/MarkAtOmniux), [Kalon Robson](https://github.com/kalon-robson)

0 commit comments

Comments
 (0)