Enum icu_datetime::options::length::Date[][src]

pub enum Date {
    Full,
    Long,
    Medium,
    Short,
}

Represents different lengths a DateTimeInput implementer can be formatted into. Each length has associated best pattern for it for a given locale.

Examples

use icu::datetime::options::length;

let bag = length::Bag {
    date: Some(length::Date::Long),
    time: None,

    preferences: None,
};

The available lengths correspond to UTS #35: Unicode LDML 4. Dates, section 2.4 Element dateFormats.

Note: The exact result returned from DateTimeFormat 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.

Variants

Full

Full length, usually with weekday name.

Examples

"Tuesday, January 21, 2020";       // en-US
"wtorek, 21 stycznia, 2020";       // pl
"الثلاثاء، ٢١ يناير ٢٠٢٠";          // ar
"вторник, 21 января 2020 г.";      // ru
"2020年1月21日火曜日";               // ja
Long

Long length, with wide month name.

Examples

"September 10, 2020";     // en-US
"10 września 2020";       // pl
"١٠ سبتمبر ٢٠٢٠";         // ar
"10 сентября 2020 г.";    // ru
"2020年9月10日";           // ja
Medium

Medium length.

Examples

"Feb 20, 2020";        // en-US
"20 lut 2020";         // pl
"٢٠‏/٠٢‏/٢٠٢٠";          // ar
"20 февр. 2020 г.";    // ru
"2020/02/20";          // ja
Short

Short length, usually with numeric month.

Examples

"1/30/20";      // en-US
"30.01.2020";   // pl
"٣٠‏/١‏/٢٠٢٠";    // ar
"30.01.2020";   // ru
"2020/01/30";   // ja

Trait Implementations

impl Clone for Date[src]

impl Copy for Date[src]

impl Debug for Date[src]

impl<'de> Deserialize<'de> for Date[src]

impl PartialEq<Date> for Date[src]

impl Serialize for Date[src]

impl StructuralPartialEq for Date[src]

Auto Trait Implementations

impl RefUnwindSafe for Date

impl Send for Date

impl Sync for Date

impl Unpin for Date

impl UnwindSafe for Date

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> ErasedDataStruct for T where
    T: Clone + Debug + Any
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.