icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

FixedDecimalFormatter and WeekCalculator should be conditionally loaded in datetime

Open sffc opened this issue 2 years ago • 10 comments

#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?

sffc avatar Nov 20 '23 23:11 sffc

Bikeshed for the function name:

  • try_new_without_fixed_decimal_formatter
  • try_new_without_decimals
  • try_new_without_number_formatting
  • try_new_bare

Opinion @zbraniecki @Manishearth @robertbastian ?

sffc avatar Nov 30 '23 18:11 sffc

3 > 2 > 1 >> 4

Manishearth avatar Dec 01 '23 04:12 Manishearth

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.

robertbastian avatar Dec 01 '23 13:12 robertbastian

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).

sffc avatar Dec 01 '23 21:12 sffc

3 > 1 > 2 >> 4

robertbastian avatar Dec 07 '23 14:12 robertbastian

Zibi also suggested try_new_without_numbers in the meeting

Manishearth avatar Mar 15 '24 09:03 Manishearth

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.

sffc avatar Mar 19 '24 19:03 sffc