pub(crate) struct ArithmeticDate<C: DateFieldsResolver> {
pub year: C::YearInfo,
pub month: u8,
pub day: u8,
}Fields§
§year: C::YearInfo§month: u81-based month of year
day: u81-based day of month
Implementations§
Source§impl ArithmeticDate<AbstractGregorian<IsoEra>>
impl ArithmeticDate<AbstractGregorian<IsoEra>>
pub(crate) fn new_gregorian<Y: GregorianYears>( year: i32, month: u8, day: u8, ) -> Result<Self, RangeError>
Source§impl<C: DateFieldsResolver> ArithmeticDate<C>
impl<C: DateFieldsResolver> ArithmeticDate<C>
pub(crate) const fn new_unchecked(year: C::YearInfo, month: u8, day: u8) -> Self
pub(crate) const fn cast<C2: DateFieldsResolver<YearInfo = C::YearInfo>>( self, ) -> ArithmeticDate<C2>
pub(crate) fn from_codes( era: Option<&str>, year: i32, month_code: MonthCode, day: u8, calendar: &C, ) -> Result<Self, DateError>
pub(crate) fn from_fields( fields: DateFields<'_>, options: DateFromFieldsOptions, calendar: &C, ) -> Result<Self, DateFromFieldsError>
pub(crate) fn try_from_ymd( year: C::YearInfo, month: u8, day: u8, ) -> Result<Self, RangeError>
Sourcepub(crate) fn new_balanced(
year: C::YearInfo,
ordinal_month: i64,
day: i64,
cal: &C,
) -> Self
pub(crate) fn new_balanced( year: C::YearInfo, ordinal_month: i64, day: i64, cal: &C, ) -> Self
Implements the Temporal abstract operation BalanceNonISODate.
This takes a year, month, and day, where the month and day might be out of range, then balances excess months into the year field and excess days into the month field.
Sourcepub(crate) fn surpasses(
&self,
other: &Self,
duration: DateDuration,
sign: i64,
cal: &C,
) -> bool
pub(crate) fn surpasses( &self, other: &Self, duration: DateDuration, sign: i64, cal: &C, ) -> bool
Implements the Temporal abstract operation NonISODateSurpasses.
This takes two dates (self and other), duration, and sign (either -1 or 1), then
returns whether adding the duration to self results in a year/month/day that exceeds
other in the direction indicated by sign, constraining the month but not the day.
Sourcepub(crate) fn added(
&self,
duration: DateDuration,
cal: &C,
options: DateAddOptions,
) -> Result<Self, DateError>
pub(crate) fn added( &self, duration: DateDuration, cal: &C, options: DateAddOptions, ) -> Result<Self, DateError>
Implements the Temporal abstract operation NonISODateAdd.
This takes a date (self) and duration, then returns a new date resulting from
adding duration to self, constrained according to options.
Sourcepub(crate) fn until(
&self,
other: &Self,
cal: &C,
options: DateDifferenceOptions,
) -> DateDuration
pub(crate) fn until( &self, other: &Self, cal: &C, options: DateDifferenceOptions, ) -> DateDuration
Implements the Temporal abstract operation NonISODateUntil.
This takes a duration (self) and a date (other), then returns a duration that, when
added to self, results in other, with largest unit according to options.