Trait holiday::before_after::BeforeAfterDate
source · pub trait BeforeAfterDate {
// Required methods
fn after(&self, date: &NaiveDate) -> NaiveDate;
fn before(&self, date: &NaiveDate) -> NaiveDate;
// Provided methods
fn after_today(&self) -> NaiveDate { ... }
fn before_today(&self) -> NaiveDate { ... }
fn first_date(&self) -> NaiveDate { ... }
fn last_date(&self) -> NaiveDate { ... }
}
Expand description
Trait to determine the next and previous occurrence of dates (successor and predecessor). The next occurrence should include the current date, the previous occurrence should exclude the current date.
Required Methods§
Provided Methods§
sourcefn after_today(&self) -> NaiveDate
fn after_today(&self) -> NaiveDate
The next occurrence including today (successor)
sourcefn before_today(&self) -> NaiveDate
fn before_today(&self) -> NaiveDate
The previous occurrence excluding today (predecessor)
sourcefn first_date(&self) -> NaiveDate
fn first_date(&self) -> NaiveDate
The first representable occurrence of the date