icu4x
icu4x copied to clipboard
FixedDecimalFormatter and WeekCalculator should be conditionally loaded in datetime
#4204 landed DateTimePatternInterpolator that always loads a FixedDecimalFormatter. Most patterns need one. However, not all patterns do, such as patterns that seek standalone display names. So should we make the FixedDecimalFormatter optional?
Maybe add a new constructor like try_new_without_fixed_decimal_formatter?
Bikeshed for the function name:
try_new_without_fixed_decimal_formattertry_new_without_decimalstry_new_without_number_formattingtry_new_bare
Opinion @zbraniecki @Manishearth @robertbastian ?
3 > 2 > 1 >> 4
So what happens if you need a FDF but used this constructor? I like the try_new_without_number_formatting concept, but then it should do naive fixed decimal formatting instead of erroring.
It would have the same behavior as if you gave the DateTimePatternInterpolator a pattern that needs abbreviated month names but you didn't load abbreviated month names (returns a MissingDateNames error).
3 > 1 > 2 >> 4
Zibi also suggested try_new_without_numbers in the meeting
Ballots: https://docs.google.com/document/d/1cwObpQ_gdCsoZVEDNV7C-7eODxElGIJ3FNdivlbLnNo/edit
Results: Option 3, try_new_without_number_formatting, wins. It is the first choice of 5 of 6 ballots and has no vetoes.