mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Fix bad sort in bill controller
This commit is contained in:
@@ -109,7 +109,7 @@ class BillController extends Controller
|
|||||||
$cache->addProperty('chart.bill.single');
|
$cache->addProperty('chart.bill.single');
|
||||||
$cache->addProperty($bill->id);
|
$cache->addProperty($bill->id);
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return response()->json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
$locale = app('steam')->getLocale();
|
$locale = app('steam')->getLocale();
|
||||||
|
|
||||||
@@ -121,7 +121,13 @@ class BillController extends Controller
|
|||||||
usort(
|
usort(
|
||||||
$journals,
|
$journals,
|
||||||
static function (array $left, array $right) {
|
static function (array $left, array $right) {
|
||||||
return $left['date']->gte($right['date']) ? 1 : 0;
|
if($left['date']->gt($right['date'])) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if($left['date']->lt($right['date'])) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user