icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

Support numeric overrides in DateTimeFormat

Open Manishearth opened this issue 2 years ago • 1 comments
trafficstars

Split out of https://github.com/unicode-org/icu4x/issues/3865

https://github.com/unicode-org/icu4x/pull/4228 adds support for numeric overrides in patterns.

We need to teach DateTimeFormat to apply these.

Manishearth avatar Oct 31 '23 22:10 Manishearth

Currently the only overrides available are d=hanidays, hanidec, hebr, M=romanlow, y=jpanyear. Out of these , the M and d ones can be hardcoded as a symbols array (though it may be better to write a short hanidays algorithm that supports numbers <100). y=jpanyear is quite straightforward: it simply uses for y=1. hanidec is a very straightforward symbol based scheme (could be done using FixedDecimalFormat, but easy enough to hardcode in a compact way).

hebr is the only real challenge (it's complicated). We can punt on this for now and use Latin until we support full RBNF, and then invoke that.

Manishearth avatar Oct 31 '23 22:10 Manishearth