pub trait BeforeAfterDate {
    fn after(&self, date: &NaiveDate) -> NaiveDate;
    fn before(&self, date: &NaiveDate) -> NaiveDate;

    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

The next occurrence after a given date

The previous occurrence before a given date

Provided Methods

The next occurrence including today (successor)

The previous occurrence excluding today (predecessor)

The first representable occurrence of the date

The last representable occurrence of the date

Implementors