Skip to content

[FEEDBACK] Don't include a time zone option, or be strict if you do #961

Open
@sffc

Description

@sffc

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:

  1. Use input time zone
    • Bad: the time zone in the message is not respected
  2. Use message zone with conversion
    • Bad: requires TZDB and mutates data in potentially unexpected ways (e.g. daylight saving time)
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LDML48LDML48 ReleasePreview-FeedbackFeedback gathered during the technical previewfunctionsIssue pertains to the default function set

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions