[][src]Function chronoutil::delta::with_year

pub fn with_year<D: Datelike>(date: D, year: i32) -> D

Shift the date to have the given year.

Ambiguous month-ends are shifted backwards as necessary. For example:

let start = NaiveDate::from_ymd(2020, 2, 29);
assert_eq!(with_year(start, 2021), NaiveDate::from_ymd(2021, 2, 28));