Module icu_datetime::fields::components

source ·
Expand description

🚧 [Experimental] Types for specifying fields in a classical datetime skeleton.

🚧 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

§Examples

use icu::datetime::fields::components;

let mut bag = components::Bag::default();
bag.year = Some(components::Year::Numeric);
bag.month = Some(components::Month::Long);
bag.day = Some(components::Day::NumericDayOfMonth);

bag.hour = Some(components::Numeric::TwoDigit);
bag.minute = Some(components::Numeric::TwoDigit);

Note: The exact formatted result is a subject to change over time. Formatted result should be treated as opaque and displayed to the user as-is, and it is strongly recommended to never write tests that expect a particular formatted output.

Structs§

Enums§

  • Options for displaying the current day of the month or year.
  • Options for displaying a Month for the components::Bag.
  • A numeric component for the components::Bag. It is used for the year, day, hour, minute, and second.
  • A text component for the components::Bag. It is used for the era and weekday.
  • Options for displaying a time zone for the components::Bag.
  • Options for displaying the current week number for the components::Bag.
  • Options for displaying a Year for the components::Bag.