FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    GregorianCalendar

    struct · ferroui-base · v0.5.0

    struct GregorianCalendar
    

    The proleptic Gregorian calendar. It has no state.

    View source

    Members

    new

    const fn new() -> GregorianCalendar
    

    Creates the calendar.

    Source

    min_supported_date_time

    const fn min_supported_date_time(self: &Self) -> DateTime
    

    The earliest date the calendar supports.

    Source

    max_supported_date_time

    const fn max_supported_date_time(self: &Self) -> DateTime
    

    The latest date the calendar supports.

    Source

    try_add_days

    fn try_add_days(self: &Self, time: DateTime, days: i32) -> Option<DateTime>
    

    time moved by a number of days; None when the result is out of range (.NET throws ArgumentException).

    Source

    add_days

    fn add_days(self: &Self, time: DateTime, days: i32) -> DateTime
    

    time moved by a number of days. Panics when the result is out of range.

    Source

    try_add_months

    fn try_add_months(self: &Self, time: DateTime, months: i32) -> Option<DateTime>
    

    time moved by a number of months, keeping the day where the resulting month has it; None when months is not in -120000..=120000 or the result is out of range.

    Source

    add_months

    fn add_months(self: &Self, time: DateTime, months: i32) -> DateTime
    

    time moved by a number of months. Panics when out of range.

    Source

    try_add_years

    fn try_add_years(self: &Self, time: DateTime, years: i32) -> Option<DateTime>
    

    time moved by a number of years; None when the result is out of range.

    Source

    add_years

    fn add_years(self: &Self, time: DateTime, years: i32) -> DateTime
    

    time moved by a number of years. Panics when out of range.

    Source

    get_day_of_week

    fn get_day_of_week(self: &Self, time: DateTime) -> DayOfWeek
    

    The day of the week of time.

    Source

    get_days_in_month

    fn get_days_in_month(self: &Self, year: i32, month: i32) -> i32
    

    The number of days of a month. Panics for an invalid year or month.

    Source

    get_week_of_year

    fn get_week_of_year(self: &Self, time: DateTime, rule: CalendarWeekRule, first_day_of_week: DayOfWeek) -> i32
    

    The number of the week of the year that contains time, counted from one, for the given rule and first day of the week.

    As in .NET, the last days of December are never counted into the first week of the following year: they get the number 53 (or 52) even where ISO 8601 says 1. Use IsoWeek::get_week_of_year for ISO numbers.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ResourceKeyObject
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Copy
    • Debug
    • Default
    • StructuralPartialEq
    • PartialEq
    • Eq
    • Hash

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.