Lines 14-20
is( t::lib::Dates::compare( $dt_2, $dt_1 ), 1, '2018 is after 2017' );
Link Here
|
14 |
is( t::lib::Dates::compare( $date_1, $date_2 ), -1, '2017 is before 2018 (strings comparison)' ); |
14 |
is( t::lib::Dates::compare( $date_1, $date_2 ), -1, '2017 is before 2018 (strings comparison)' ); |
15 |
is( t::lib::Dates::compare( $date_2, $date_1 ), 1, '2018 is after 2017 (strings comparison)' ); |
15 |
is( t::lib::Dates::compare( $date_2, $date_1 ), 1, '2018 is after 2017 (strings comparison)' ); |
16 |
|
16 |
|
17 |
my $dt_3 = $dt_1->clone->subtract( seconds => 59 ); |
17 |
my $dt_3 = $dt_1->clone->subtract( seconds => 5 ); |
18 |
is( t::lib::Dates::compare( $dt_1, $dt_3 ), |
18 |
is( t::lib::Dates::compare( $dt_1, $dt_3 ), |
19 |
0, 'If there is less than 1min, the dates are considered identicals' ); |
19 |
0, 'If there is less than 1min, the dates are considered identicals' ); |
20 |
is( t::lib::Dates::compare( $dt_3, $dt_1 ), |
20 |
is( t::lib::Dates::compare( $dt_3, $dt_1 ), |