pub fn as_years(&self, inc_part: bool) -> i32 {
        let dur = self.as_duration();
        dur.years()
            + if inc_part && (dur.days() > 0 || dur.months() > 0) {
                1
            } else {
                0
            }
    }
/// Return the number of years that can fit in the `DateRange`.
/// If inc_part is false, part years will be discarded e.g. 500 days -> 1 year.
/// If inc_part is true, part years will count as an extra period e.g. 500 days -> 2 years.
Return the number of years that can fit in the `DateRange`.
If inc_part is false, part years will be discarded e.g.
Return the number of years that can fit in the ` DateRange ` . If inc_part is false part years will be discarded e . g .
pub fn as_years(&self, inc_part: bool) -> i32 {
        let dur = self.as_duration();
        dur.years()
            + if inc_part && (dur.days() > 0 || dur.months() > 0) {
                1
            } else {
                0
            }
    }
pub fn as_years ( & self , inc_part : bool ) -> i32 { let dur = self . as_duration ( ) ; dur . years ( ) + if inc_part && ( dur . days ( ) > 0 || dur . months ( ) > 0 ) { 1 } else { 0 } }
Return the number of years that can fit in the `DateRange`.
Return the number of years that can fit in the ` DateRange ` .
&self
inc_part
bool
&self
inc_part
bool