Description
Conflicts between time zones coming from different sources has been a persistent pain point that the Temporal champions have worked to avoid. It would be nice for MessageFormat to not repeat the same situation.
The problem is, what do you do if someone passes a ZonedDateTime
to a MessageFormat
configured with a :datetime
field with a timeZone
option? There are two time zones to choose from, and none of the resolution options are great:
- Use input time zone
- Bad: the time zone in the message is not respected
- Use message zone with conversion
- Bad: requires TZDB and mutates data in potentially unexpected ways (e.g. daylight saving time)
- Use message zone without conversion
- Bad: displaying an instant that differs from the input
In the Temporal specification, we handle the problem by disallowing a ZonedDateTime to be passed as input.
https://tc39.es/proposal-temporal/#sec-temporal-handledatetimevalue
However, a better design would be to forbid the formatter itself from having a time zone option, a luxury we didn't have when integrating Temporal with the pre-existing Intl.DateTimeFormat.