pub fn from_dates(from: Date, to: Date) -> Self {
        // If dates ordered with from before to, then just run a normal
        // duration calc
        if to > from {
            return Self::from_dates_pos(from, to);
        }

        // Here dates ordered the other way around: calculate the duration
        // the right way around and then reverse the sign of all the parts
        Self::from_dates_pos(to, from).invert()
    }
/// Create a new `Duration` from a pair of dates
///
/// The order of application of years, months and days **matters**.
/// In the forwards direction it is assumed that  periods are added
/// in the following order:
/// 1) years
/// 2) months
/// 3) days
///
/// However, after the addition of years and months it can be the case
/// that an invalid date has been arrived at. This occurs when a
/// "long" month date gets applied to a "short" month, normally when
/// the "from" day is the 31st, although February will restrict a few
/// days more. To solve the invalid intermediate date issue, and only when
/// this is found to occur, the day part diff will instead be done first.
/// Years then months will follow for this edge case.
///
/// If swapping the part application order also fails, for example when
/// there is no day part to the duration, then the intermediate date is
/// truncated to be end of month following the year/month move.
///
/// For negative durations, it is enforced that the duration parts are
/// kept the same as a forward duration between the two dates, i.e.
/// the duration that would be assessed if the order of the dates were
/// transposed. The consequence of this decision are that for negative
/// durations the order in which the parts are subtracted is reversed,
/// as comapred to a forward duration:
/// 1) days
/// 2) months
/// 3) years
///
/// A similar order transposition will occur if an invalid intermediate
/// date is arrived at
Create a new `Duration` from a pair of dates
The order of application of years, months and days **matters**.
In the forwards direction it is assumed that  periods are added
in the following order:
1) years
2) months
3) days

However, after the addition of years and months it can be the case
that an invalid date has been arrived at.

If swapping the part application order also fails, for example when
there is no day part to the duration, then the intermediate date is
truncated to be end of month following the year/month move.

For negative durations, it is enforced that the duration parts are
kept the same as a forward duration between the two dates, i.e.
the duration that would be assessed if the order of the dates were
transposed. The consequence of this decision are that for negative
durations the order in which the parts are subtracted is reversed,
as comapred to a forward duration:
1) days
2) months
3) years

A similar order transposition will occur if an invalid intermediate
date is arrived at
Create a new ` Duration ` from a pair of dates The order of application of years months and days ** matters ** . In the forwards direction it is assumed that periods are added in the following order : 1 ) years 2 ) months 3 ) days However after the addition of years and months it can be the case that an invalid date has been arrived at . If swapping the part application order also fails for example when there is no day part to the duration then the intermediate date is truncated to be end of month following the year / month move . For negative durations it is enforced that the duration parts are kept the same as a forward duration between the two dates i . e . the duration that would be assessed if the order of the dates were transposed . The consequence of this decision are that for negative durations the order in which the parts are subtracted is reversed as comapred to a forward duration : 1 ) days 2 ) months 3 ) years A similar order transposition will occur if an invalid intermediate date is arrived at
pub fn from_dates(from: Date, to: Date) -> Self {
        // If dates ordered with from before to, then just run a normal
        // duration calc
        if to > from {
            return Self::from_dates_pos(from, to);
        }
        // Here dates ordered the other way around: calculate the duration
        // the right way around and then reverse the sign of all the parts
        Self::from_dates_pos(to, from).invert()
    }
pub fn from_dates ( from : Date , to : Date ) -> Self { // If dates ordered with from before to, then just run a normal // duration calc if to > from { return Self :: from_dates_pos ( from , to ) ; } // Here dates ordered the other way around: calculate the duration // the right way around and then reverse the sign of all the parts Self :: from_dates_pos ( to , from ) . invert ( ) }
Create a new `Duration` from a pair of dates
The order of application of years, months and days **matters**.
Create a new ` Duration ` from a pair of dates The order of application of years months and days ** matters ** .
from
Date
to
Date
from
Date
to
Date