-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(ui): improve the labels for default timeones #12746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
This doesn't address my concern—it’s an aesthetic change that some might prefer, but it’s subjective. I also think it’s a stretch to apply that research to this context. The study focuses on helping users identify their current timezone, prioritizing ease of use, not suitability for contexts like ours. For example, Slack’s timezone selector only affects how UTM dates are localized to the user’s preference. Payload’s case is the opposite: the UI must de-localize user-selected dates to UTM. In fact, the article highlights a key distinction between timezones and timezone offsets—a distinction we should be careful not to blur. Here’s an example of the problem:
(Note that Berlin's offset on June 1st is If the user selects 2PM as above, what ISO string should be stored? Should it be
To summarise, I think it's very misguided to associate these timezone offsets with datetime-pickers, specifically. By all means, use them in other contexts that more closely resemble the conditions of that NN Group study, but not here. |
Please tell me T12:00:00Z is stored. It'll be easy enough to tell people to basically ignore the "+01:00" label, it'll be impossible to get them to do their own timezone calculations to get the intended effect. Besides that: completely agree with @ryami333 above: the offset should not be displayed here, as it'll be wrong a significant portion of the time. |
| { label: 'Islamabad, Karachi - Asia (UTC+05:00)', value: 'Asia/Karachi' }, | ||
| { label: 'Jakarta - Asia (UTC+07:00)', value: 'Asia/Jakarta' }, | ||
| { label: 'Lagos - Africa (UTC+01:00)', value: 'Africa/Lagos' }, | ||
| { label: 'London, Lisbon (GMT) - Europe (UTC+00:00)', value: 'Europe/London' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Europe/London and Europe/Lisbon are not equivalent! This seems a bit ChatGPT hallucination-ish.
| { label: 'Jakarta - Asia (UTC+07:00)', value: 'Asia/Jakarta' }, | ||
| { label: 'Lagos - Africa (UTC+01:00)', value: 'Africa/Lagos' }, | ||
| { label: 'London, Lisbon (GMT) - Europe (UTC+00:00)', value: 'Europe/London' }, | ||
| { label: 'Midway Island, Samoa - Pacific (UTC-11:00)', value: 'Pacific/Midway' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Midway Island is not in Samoa, though it does use "Samoa Standard Time" which is not actually used in Apia, Samoa, ironically. I hope that this is illustrating just how important it is to just label a datetime-picker with just the IANA labels: Pacific/Midway and Pacific/Apia respectively.
|
@paulpopus I'd quite like to revive this topic – I think I've illustrated the problems with this approach (and the incumbent approach) and I really do think that there's no sense in over-engineering this. I think this PR should either be closed or adapted to something closer to the following, which I've been adding to all of my Payload apps as a temporary workaround: // payload.config.ts
export default buildConfig({
// …
admin: {
// …
timezones: {
/**
* ✝ Workaround for Payload issue, where dynamic timezones like
* "Europe/Berlin" are labelled as if they have fixed offsets like UTC+01,
* when in fact they depend on factors such as daylight-savings-time.
*
* https://github.com/payloadcms/payload/issues/12700
*/
supportedTimezones: ({ defaultTimezones }) => {
return defaultTimezones
.map((item) => ({
label: item.value, // overriding this label
value: item.value,
}))
.sort((a, b) => a.label.localeCompare(b.label));
},
},
},
// …
});
export default payloadConfig; |

Addresses #12700
Based on feedback, the current visual labels for the timezones we provide are not necessarily intuitive for people to use. Based on this article from NN Group, I've changed the labels so they follow a more recommended format to
Cities - Region (Offset)instead of(Offset) - Citiesso people can search and filter by region as well such asEuropewhen trying to narrow down their locations.We're going to keep offsets based on the paper there but in the future we could enhance the picker here by: