You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: docs/admin/overview.mdx
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -301,6 +301,35 @@ We validate the supported timezones array by checking the value against the list
301
301
information.
302
302
</Banner>
303
303
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
+
304
333
## Toast
305
334
306
335
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