icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

Add direct symbol getters on FixedCalendarDateTimeNames

Open sffc opened this issue 11 months ago • 2 comments

For example, we could add a getter for the "AM" day period symbol. Maybe also the era codes, weekdays, and month names (need to think about standalone formats and capitalization context for those).

A Good First Issue would be to add the AM/PM getters. They should return Some if the data is loaded or None if not loaded. Example function signature: get_am(&self) -> Option<&str>

sffc avatar May 16 '25 08:05 sffc

@sffc why get_*? I believe Rust promotes skipping get_ for getters.

zbraniecki avatar Oct 23 '25 15:10 zbraniecki

Good point, I didn't consider that.

This type has a lot of functions, like load_* and include_*, and it seems nice to maybe group these ones as get_*. But, it's also nice when reading code to just have names.am() instead of names.get_am().

sffc avatar Oct 23 '25 16:10 sffc