Module icu_datetime::fieldset

source ·
Expand description

All available field sets for datetime formatting.

Each field set is a struct containing options specified to that field set. The fields can either be set directly or via helper functions.

§Examples

Two ways to configure the same field set:

use icu::datetime::fieldset::YMDT;
use icu::datetime::options::{Alignment, TimePrecision, YearStyle};

let field_set_1 = YMDT::long()
    .with_year_style(YearStyle::Full)
    .with_alignment(Alignment::Column)
    .with_time_precision(TimePrecision::MinuteExact);

let mut field_set_2 = YMDT::long();
field_set_2.year_style = Some(YearStyle::Full);
field_set_2.alignment = Some(Alignment::Column);
field_set_2.time_precision = Some(TimePrecision::MinuteExact);

assert_eq!(field_set_1, field_set_2);

Modules§

  • Enumerations over field sets.
  • 🚧 [Experimental] Types for dealing with serialization of semantic skeletons.

Structs§

  • Struct for combining date/time fields with zone fields.
  • “17” ⇒ day of month (standalone)
  • “17 Friday” ⇒ day of month and weekday
  • “17 Friday, 3:47:50 PM” ⇒ day of month and weekday with time
  • “17, 3:47:50 PM” ⇒ day of month (standalone) with time
  • “Friday” ⇒ weekday (standalone)
  • “Friday 3:47:50 PM” ⇒ weekday (standalone) with time
  • “Chicago Time” ⇒ time zone in location format
  • “May” ⇒ month (standalone)
  • “May 17” ⇒ month and day
  • “Fri, May 17” ⇒ month, day, and weekday
  • “Fri, May 17, 3:47:50 PM” ⇒ month, day, and weekday with time
  • “May 17, 3:47:50 PM” ⇒ month and day with time
  • “GMT-5” ⇒ UTC offset
  • “3:47:50 PM” ⇒ time (locale-dependent hour cycle)
  • “Central Time” ⇒ time zone in generic non-location format
  • “CT” ⇒ time zone in generic non-location format (only short)
  • “2024” ⇒ year (standalone)
  • “May 2024” ⇒ year and month
  • “5/17/24” ⇒ year, month, and day
  • “Fri, 5/17/24” ⇒ year, month, day, and weekday
  • “Fri, 5/17/24, 3:47:50 PM” ⇒ year, month, day, and weekday with time
  • “5/17/24, 3:47:50 PM” ⇒ year, month, and day with time
  • “Central Daylight Time” ⇒ time zone in specific non-location format
  • “CDT” ⇒ time zone in specific non-location format (only short)

Type Aliases§

  • “17 May 2024, 15:47:50 GMT+1” ⇒ locale-dependent date and time fields with a time zone
  • “17 May 2024, 15:47:50 GMT” ⇒ locale-dependent date and time fields with a time zone
  • “17 May 2024, 15:47:50 BST” ⇒ locale-dependent date and time fields with a time zone