Struct icu_calendar::Date
source · [−]pub struct Date<A: AsCalendar> { /* private fields */ }
Expand description
A date for a given calendar
This can work with wrappers arount Calendar
types,
e.g. Rc<C>
, via the AsCalendar
trait
Implementations
pub fn new_buddhist_date(
year: IsoYear,
month: IsoMonth,
day: IsoDay
) -> Result<Date<Buddhist>, DateTimeError>
pub fn new_buddhist_date(
year: IsoYear,
month: IsoMonth,
day: IsoDay
) -> Result<Date<Buddhist>, DateTimeError>
Construct a new Buddhist Date
Construct a date from an ISO date and some calendar representation
Convert the Date to a date in a different calendar
The number of months in the year of this date
The number of days in the year of this date
The number of days in the month of this date
The day of the week for this date
Monday is 1, Sunday is 7, according to ISO
Add a duration
to this date, mutating it
Add a duration
to this date, returning the new one
pub fn until<B: AsCalendar<Calendar = A::Calendar>>(
&self,
other: &Date<B>,
largest_unit: DateDurationUnit,
smallest_unit: DateDurationUnit
) -> DateDuration<A::Calendar>
pub fn until<B: AsCalendar<Calendar = A::Calendar>>(
&self,
other: &Date<B>,
largest_unit: DateDurationUnit,
smallest_unit: DateDurationUnit
) -> DateDuration<A::Calendar>
Calculating the duration between other - self
The calendar-specific day-of-month represented by self
The calendar-specific day-of-month represented by self
Construct a date from raw values for a given calendar. This does not check any invariants for the date and calendar, and should only be called by calendar implementations.
Calling this outside of calendar implementations is sound, but calendar implementations are not expected to do anything sensible with such invalid dates.
pub fn new_gregorian_date(
year: IsoYear,
month: IsoMonth,
day: IsoDay
) -> Result<Date<Gregorian>, DateTimeError>
pub fn new_gregorian_date(
year: IsoYear,
month: IsoMonth,
day: IsoDay
) -> Result<Date<Gregorian>, DateTimeError>
Construct a new Gregorian Date
pub fn new_iso_date(
year: IsoYear,
month: IsoMonth,
day: IsoDay
) -> Result<Date<Iso>, DateTimeError>
pub fn new_iso_date(
year: IsoYear,
month: IsoMonth,
day: IsoDay
) -> Result<Date<Iso>, DateTimeError>
Construct a new ISO Date
pub fn new_iso_date_from_integers(
year: i32,
month: u8,
day: u8
) -> Result<Date<Iso>, DateTimeError>
pub fn new_iso_date_from_integers(
year: i32,
month: u8,
day: u8
) -> Result<Date<Iso>, DateTimeError>
Construct a new ISO date from integers
pub fn new_julian_date(
year: IsoYear,
month: IsoMonth,
day: IsoDay
) -> Result<Date<Julian>, DateTimeError>
pub fn new_julian_date(
year: IsoYear,
month: IsoMonth,
day: IsoDay
) -> Result<Date<Julian>, DateTimeError>
Construct new Julian Date
pub fn new_julian_date_from_integers(
year: i32,
month: u8,
day: u8
) -> Result<Date<Julian>, DateTimeError>
Trait Implementations
impl<C, A, B> PartialEq<Date<B>> for Date<A> where
C: Calendar,
A: AsCalendar<Calendar = C>,
B: AsCalendar<Calendar = C>,
impl<C, A, B> PartialEq<Date<B>> for Date<A> where
C: Calendar,
A: AsCalendar<Calendar = C>,
B: AsCalendar<Calendar = C>,
Auto Trait Implementations
impl<A> RefUnwindSafe for Date<A> where
A: RefUnwindSafe,
<<A as AsCalendar>::Calendar as Calendar>::DateInner: RefUnwindSafe,
impl<A> Unpin for Date<A> where
A: Unpin,
<<A as AsCalendar>::Calendar as Calendar>::DateInner: Unpin,
impl<A> UnwindSafe for Date<A> where
A: UnwindSafe,
<<A as AsCalendar>::Calendar as Calendar>::DateInner: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn filterable(
self,
filter_name: &'static str
) -> RequestFilterDataProvider<T, fn(&DataRequest) -> bool>
pub fn filterable(
self,
filter_name: &'static str
) -> RequestFilterDataProvider<T, fn(&DataRequest) -> bool>
Creates a filterable data provider with the given name for debugging. Read more