fluent.js icon indicating copy to clipboard operation
fluent.js copied to clipboard

Intl.DateTimeFormat timeZone option

Open binkztep opened this issue 2 years ago • 2 comments

why it is not supported? it would allow to display timezone in specific timezone

list of allowed options: https://github.com/projectfluent/fluent.js/blob/36a895b706b42e114d2677949610f96287093367/fluent-bundle/src/builtins.ts#L99

more than that, in Syntax guide its named as "Developers params", which intuitively feels like it should be supported https://projectfluent.org/fluent/guide/functions.html#partial-arguments

binkztep avatar Apr 03 '23 21:04 binkztep

To set timeZone, you need to use a partially formatted FluentDateTime variable, and to set the option in its constructor. This is intentionally not possible via the DATETIME() message function as it could far too easily lead to mistakes. For the same reason, e.g. the currency option of FluentNumber needs to be set via a partially formatter variable.

eemeli avatar Apr 04 '23 11:04 eemeli