Expand description

🚧 [Experimental] Types to hold user preferences to configure a DateTimeFormatter.

✨ Enabled with the experimental Cargo feature.

Preferences is a bag of options to be associated with either length::Bag or components::Bag which provides information on user preferences that can affect the result of the formatting.

🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature of the icu meta-crate. Use with caution. #1317

Unicode Extensions

User preferences will often be stored as part of the Locale identified as Unicode Extensions, but for scenarios where the application stores information about user preferences they can be also provided via this bag (and if they are, they will take precedence over unicode extensions from the locale).

Examples

use icu::datetime::options::preferences;

let prefs = preferences::Bag::from_hour_cycle(preferences::HourCycle::H23);

Structs

  • Stores user preferences which may affect the result of date and time formatting.

Enums

  • A user preference for adjusting how the hour component is displayed.