Neither DateTime::Format::Excel nor DateTime::Event::Sunrise pass their
own tests. They were both broken when the subtraction in DateTime
changed, from returning days and seconds to returning y,m,d, h,m,s.

DT::E::Sunrise uses the subtraction in its function
days_since_2000_Jan_0(), and DT::F::Excel in format_datetime(). Both
then call delta_days to see how many days have passed; this is now
broken.

There should probably an option in DateTime::subtract_datetime() to
specify which units should be returned. For example:

    $dt1->subtract_datetime( $dt2,
                             [ 'months', 'days', 'minutes', 'seconds' ] );

would be equivalent to the current behaviour;

    $dt1->subtract_datetime( $dt2, [ 'days', 'seconds' ] );

is the old version, that would be used by the two modules I mentioned
(or:

    $dt1->subtract_datetime( $dt2, [ 'days' ] );

as the seconds value is not used;

    $dt1->subtract_datetime( $dt2, [ 'seconds' ] );

is equivalent to subtract_datetime_absolute().

Would this be easy to implement?

Eugene

Reply via email to