Expand description

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

Each variant of the bag is a combination of settings defining 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::length};

let bag = length::Bag::from_date_time_style(length::Date::Medium, length::Time::Short);

At the moment only the length::Bag works, and we plan to extend that to support ECMA402-like components bag later.

Modules

Implementation status

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

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.

Enums

A bag of options which, together with Locale, defines how dates will be formatted with a DateTimeFormat instance.