Description
Describe the Bug
Currently, the defaultTimezones
entries are formatted like:
{ label: '(UTC+01:00) Berlin, Paris', value: 'Europe/Berlin' }
This representation is misleading because it implies that Europe/Berlin has a constant offset of UTC+01:00, when in fact the actual offset changes throughout the year due to daylight saving time. For example:
- In winter (CET), Europe/Berlin is UTC+01:00.
- In summer (CEST), Europe/Berlin is UTC+02:00.
By displaying (UTC+01:00) alongside Europe/Berlin, users may be led to believe that Berlin is always UTC+01:00, which is incorrect. This can cause confusion or even bugs when dealing with time calculations, scheduling, or cross-timezone coordination.
A more accurate approach might be:
- Omit the fixed UTC offset entirely, and simply list the timezone name as both its
value
andlabel
, (e.g.,{ label: "Europe/Berlin", value: "Europe/Berlin" }
). - Or, dynamically calculate the current offset at runtime using the system clock or user-selected date (using e.g. Intl.DateTimeFormat), so that the displayed offset reflects the actual current offset for that timezone.
I think that the first option is safer and more correct, because the timezones are rendered alongside date fields where the date value can't be predicted to be within daylight-saving-time (or not).
Maintaining a hardcoded fixed offset with a dynamic timezone creates a false equivalence and can be a source of subtle time-related errors.
Link to the code that reproduces this issue
Reproduction Steps
No reproduction needed, the issue is conceptual, not logical. Simply note that there are incorrect offsets for European timezones at the moment, for example Europe/Berlin
currently has an offset of UTC+2 due to daylight savings time, and that the static labels do not (and cannot) reflect this correctly for all timezones at all time.
Which area(s) are affected? (Select all that apply)
area: ui
Environment Info
Irrelevant.