icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

ICU4XZonedDateTimeFormatter should take an optional date and time length

Open sffc opened this issue 1 year ago • 2 comments

Currently the FFI function ICU4XZonedDateTimeFormatter::create_with_lengths takes a non-optional date length and time length. However, the Rust equivalent function takes these as optional. We should reflect the optionality in FFI.

Unclear which approach we should take:

  1. Optional argument. Need to add support for this to Diplomat.
  2. Add a None variant to the enums in FFI.

CC @robertbastian @mosuem

sffc avatar Mar 18 '24 12:03 sffc

I am not sure if I am the right person, but I feel we should add this support in the Diplomat. This seems to be a common feature and it should feel like writing native Rust.

ashu26jha avatar Mar 22 '24 02:03 ashu26jha

Option 2 is not doable at the moment, because the enums are shared with TimeFormatter et al, where they are not optional.

We have optionals in Diplomat now, so I think we should do 1. (edit: actually input Optionals still need work...)

robertbastian avatar Mar 26 '24 16:03 robertbastian