[][src]Module icu::datetime::options

DateTimeFormatOptions is a bag of options which, together with LanguageIdentifier, define how dates will be formatted be a DateTimeFormat instance.

Each variant of the bag is a combination of settings definiting how to format the date, with an optional Preferences which represent user preferences and may alter how the selected pattern is formatted.

Examples

use icu_datetime::{DateTimeFormatOptions, options::style};

let options = DateTimeFormatOptions::Style(
    style::Bag {
         date: Some(style::Date::Medium),
         time: Some(style::Time::Short),
        ..Default::default()
    }
);

At the moment only the Style bag works, and we plan to extend that to support ECMA 402 like components bag later.

Modules

components

Components is a model of encoding information on how to format date and time by specifying a list of components the user wants to be visible in the formatted string and how each field should be displayed.

preferences

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

style

Style is a model of encoding information on how to format date and time by specifying the preferred length of date and time fields.

Enums

DateTimeFormatOptions

DateTimeFormatOptions is a bag of options which, together with LanguageIdentifier, define how dates will be formatted be a DateTimeFormat instance.