Closed mrtnmtth closed 8 months ago
There is a regression in DifferenceTrait::diffInWeekdays() for Chronos 2.4.x
DifferenceTrait::diffInWeekdays()
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.
0
In 2.4.3 diffInWeekdays() returns 1.
diffInWeekdays()
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().
DifferenceTrait::diffFiltered()
https://github.com/cakephp/chronos/blob/96f28ddfceba2ff56e0d2405c28d789bd546ff55/src/Traits/DifferenceTrait.php#L185-L190
Thanks a lot for fixing.
Will you push a bugfix release for version 2.4?
There is a regression in
DifferenceTrait::diffInWeekdays()
for Chronos 2.4.xCode example:
In 2.3.3 the result is
0
as I would expect.In 2.4.3
diffInWeekdays()
returns1
.Edited the example code because I had it wrong at first.