-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Notes from an offline discussion with @robertbastian
There is a general problem with ICU4X and ECMA compatibility regarding zoned formatting.
- ICU4X interprets a datetime as in the target timezone, so would format 11:00 in Los Angeles as
11:00, PST
regardless of the local time. - ECMA interprets a datetime as in the local timezone, so would format 11:00 in Los Angeles as
02:00, PST
, if the user is in Berlin.
We would prefer having ICU4X's behavior, but ECMA does not expose the calculation, it's only implicitly done during formatting.
Possible solutions:
- Have the user input the offset for the timezone manually, and add it to the date time in ICU4X. Pro: This will result in the same behavior as ECMA, formatting 11:00 as 02:00. Con: This will fail for edge cases such as DST changes.
- Same thing, but subtract in ECMA, to get the ICU4X behavior.
- Same thing, but only allow UTC datetimes - this resolves the edge cases.
- Read a timezone database using FFI, and use it to adapt the ICU4X code to match ECMA. Pro: Everything will work great, no additional code size. Con: Can't be read on windows, the behavior will be the ECMA one, which is not desirable. Is additional work.
Options for next steps:
- Remove all timezone formatting for now, and implement solution 4 later on.
- Keep the user input of offsets, and the manual subtraction, so solution 3.
robertbastian
Metadata
Metadata
Assignees
Labels
No labels