2.4.x: diffInWeekdays() is 1 for same day
mrtnmtth opened this issue · comments
There is a regression in DifferenceTrait::diffInWeekdays()
for Chronos 2.4.x
Code example:
$input = new FrozenDate();
$input = FrozenDate::instance($input);
$today = new FrozenDate();
echo $today->diffInWeekdays($input);
In 2.3.3 the result is 0
as I would expect.
In 2.4.3 diffInWeekdays()
returns 1
.
Edited the example code because I had it wrong at first.
Found the cause of the issue. It's this hack in DifferenceTrait::diffFiltered()
.
chronos/src/Traits/DifferenceTrait.php
Lines 185 to 190 in 96f28dd
Thanks a lot for fixing.
Will you push a bugfix release for version 2.4?