Trait icu_datetime::input::DateInput

source ·
pub trait DateInput {
    type Calendar: Calendar;

    // Required methods
    fn year(&self) -> Option<FormattableYear>;
    fn month(&self) -> Option<FormattableMonth>;
    fn day_of_month(&self) -> Option<DayOfMonth>;
    fn iso_weekday(&self) -> Option<IsoWeekday>;
    fn day_of_year_info(&self) -> Option<DayOfYearInfo>;
    fn any_calendar_kind(&self) -> Option<AnyCalendarKind>;
    fn to_iso(&self) -> Date<Iso>;
}
Expand description

Representation of a formattable calendar date. Supports dates in any calendar system that uses solar days indexed by an era, year, month, and day.

All fields are optional. If a field is not present but is required when formatting, an error result will be returned from the formatter.

All data represented in DateInput should be locale-agnostic.

Required Associated Types§

source

type Calendar: Calendar

The calendar this date relates to

Required Methods§

source

fn year(&self) -> Option<FormattableYear>

Gets the era and year input.

source

fn month(&self) -> Option<FormattableMonth>

Gets the month input.

source

fn day_of_month(&self) -> Option<DayOfMonth>

Gets the day input.

source

fn iso_weekday(&self) -> Option<IsoWeekday>

Gets the weekday input.

source

fn day_of_year_info(&self) -> Option<DayOfYearInfo>

Gets information on the position of the day within the year.

source

fn any_calendar_kind(&self) -> Option<AnyCalendarKind>

Gets the kind of calendar this date is for, if associated with AnyCalendar In most cases you’ll probably want to return AnyCalendarKind::Iso.

source

fn to_iso(&self) -> Date<Iso>

Converts date to ISO

Implementations on Foreign Types§

source§

impl<C: Calendar, A: AsCalendar<Calendar = C>> DateInput for Date<A>

source§

fn year(&self) -> Option<FormattableYear>

Gets the era and year input.

source§

fn month(&self) -> Option<FormattableMonth>

Gets the month input.

source§

fn day_of_month(&self) -> Option<DayOfMonth>

Gets the day input.

source§

fn iso_weekday(&self) -> Option<IsoWeekday>

Gets the weekday input.

source§

fn day_of_year_info(&self) -> Option<DayOfYearInfo>

Gets information on the position of the day within the year.

§

type Calendar = C

source§

fn any_calendar_kind(&self) -> Option<AnyCalendarKind>

source§

fn to_iso(&self) -> Date<Iso>

source§

impl<C: Calendar, A: AsCalendar<Calendar = C>> DateInput for DateTime<A>

source§

fn year(&self) -> Option<FormattableYear>

Gets the era and year input.

source§

fn month(&self) -> Option<FormattableMonth>

Gets the month input.

source§

fn day_of_month(&self) -> Option<DayOfMonth>

Gets the day input.

source§

fn iso_weekday(&self) -> Option<IsoWeekday>

Gets the weekday input.

source§

fn day_of_year_info(&self) -> Option<DayOfYearInfo>

Gets information on the position of the day within the year.

§

type Calendar = C

source§

fn any_calendar_kind(&self) -> Option<AnyCalendarKind>

source§

fn to_iso(&self) -> Date<Iso>

Implementors§