Trait gregorian::DateResultExt
source · pub trait DateResultExt {
fn or_next_valid(&self) -> Date;
fn or_prev_valid(&self) -> Date;
}
Expand description
Extension for Result<Date>
to round invalid dates.
Required Methods
sourcefn or_next_valid(&self) -> Date
fn or_next_valid(&self) -> Date
Get the date or the next valid date.
This function gives the first day of the next month for the invalid date. It ignores any excess days in the invalid date.
sourcefn or_prev_valid(&self) -> Date
fn or_prev_valid(&self) -> Date
Get the date or the next valid date.
This function gives the last day of the current month for the invalid date. It ignores any excess days in the invalid date.