Skip to content

Commit de5f3db

Browse files
authored
docs: clarify admin.timezones list configuration with example (#14238)
<!-- Thank you for the PR! Please go through the checklist below and make sure you've completed all the steps. Please review the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository if you haven't already. The following items will ensure that your PR is handled as smoothly as possible: - PR Title must follow conventional commits format. For example, `feat: my new feature`, `fix(plugin-seo): my fix`. - Minimal description explained as if explained to someone not immediately familiar with the code. - Provide before/after screenshots or code diffs if applicable. - Link any related issues/discussions from GitHub or Discord. - Add review comments if necessary to explain to the reviewer the logic behind a change --> ### What? Added an example for the `admin.timezones` list in the documentation. ### Why? Took me a while to get the types down. Maybe it helps someone else :) ### How? https://github.com/payloadcms/payload/blob/8706537b54787e862e10c070388d662bd0042a4b/docs/admin/overview.mdx?plain=1#L304-L331
1 parent 88cb687 commit de5f3db

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/admin/overview.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,35 @@ We validate the supported timezones array by checking the value against the list
301301
information.
302302
</Banner>
303303

304+
For example:
305+
306+
```ts
307+
import { buildConfig } from 'payload'
308+
309+
const config = buildConfig({
310+
// ...
311+
admin: {
312+
timezones: {
313+
supportedTimezones: [
314+
{
315+
label: "Europe/Dublin",
316+
value: "Europe/Dublin",
317+
},
318+
{
319+
label: "Europe/Amsterdam",
320+
value: "Europe/Amsterdam",
321+
},
322+
{
323+
label: "Europe/Bucharest",
324+
value: "Europe/Bucharest",
325+
},
326+
],
327+
defaultTimezone: "Europe/Amsterdam",
328+
},
329+
},
330+
})
331+
```
332+
304333
## Toast
305334

306335
The `admin.toast` configuration allows you to customize the handling of toast messages within the Admin Panel, such as increasing the duration they are displayed and limiting the number of visible toasts at once.

0 commit comments

Comments
 (0)