Newsletter 5 | 18.02.2025
The Payload team is currently focused on stability & performance improvements. While there are no major flashy features, we have some worthwhile improvements to look at:
Timezone support on date fields
Working with dates & timezones has been confusing for a long time. To make working with dates easier, you can now add the "timezone" attribute to any date field
{
type: 'date',
name: 'date',
timezone: true,
}
This will add a small select below the date field, where you can choose the timezone.
All dates are still stored in UTC. You will now have an additional field "date_tz" that stores the timezone as the IANA timezone name. Find a good list of those here. Here's how it looks like:
You can also customise & add your own timezones to select, by adding the "admin.timezones" attribute in the Payload Config:
{
// ...
admin: {
// ...
timezones: {
supportedTimezones: ({ defaultTimezones }) => [
...defaultTimezones,
{
label: 'My Custom Timezone',
value: 'America/Monterrey'
},
],
defaultTimezone: 'America/Monterrey',
},
}
}
Text field: hasMany
If you didn't know already, you can set the "hasMany" attribute on a text field to true. This will change the text input to store an ordered array of strings instead of just one
Cool, but where is the ecom template?
Good news here, it's nearly complete! According to the Payload team, there will be a "usable, unpolished" version ready by the end of this week.
Along with adjustments for Payload V3, it adds more built-in features, reducing reliance on Stripe and paving the way for integrating other payment providers in the future. Other features include:
- Products with variants, custom pricing
- User accounts with cart sync
- Guest checkout
- Viewing order history as user and guest
Bulk Edit for file uploads
Bulk upload was one of the main features introduced in V3. However until recently, you had to edit every single upload element on its own. Very impractical if you're trying to upload 100 images at the same time and need to set one field to be the same on every element. This issue is now solved with a new "bulk edit" feature:
Plugin Showcase: Payload Bites
A cool plugin collection which seems to be becoming a small "swiss army knife" for payload.
https://github.com/rilrom/payload-bites/tree/main
It currently contains these 4 sub-plugins:
- Image search - search for images in Payload using image providers such as Unsplash and Pexels.
- Fullscreen editor - provides a fullscreen mode for the lexical rich text editor.
- Audit fields - add createdBy and lastModifiedBy fields automatically to collections and globals.
- Soft delete - "Hides" documents instead of deleting them completely.
Shout out to Riley for making this toolkit! We’re grateful for any constructive feedback, so please fill out this feedback form or reach out to info@10xmedia.de