From 850e47d8dbc0e804a3cbc260f826ddb5e2bcd7d4 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 20 Apr 2024 08:15:17 +0200 Subject: [PATCH] Fix https://github.com/firefly-iii/firefly-iii/issues/8776 --- app/Support/Navigation.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index 215d69cf0a..a867e64e3e 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -465,13 +465,13 @@ class Navigation $format = $this->preferredCarbonFormat($start, $end); $displayFormat = (string)trans('config.month_and_day_js', [], $locale); // increment by month (for year) - if ($start->diffInMonths($end, true) > 1) { + if ($start->diffInMonths($end, true) > 1.0) { $increment = 'addMonth'; $displayFormat = (string)trans('config.month_js'); } // increment by year (for multi-year) - if ($start->diffInMonths($end, true) > 12) { + if ($start->diffInMonths($end, true) > 12.0) { $increment = 'addYear'; $displayFormat = (string)trans('config.year_js'); } @@ -494,11 +494,11 @@ class Navigation public function preferredCarbonFormat(Carbon $start, Carbon $end): string { $format = 'Y-m-d'; - if ((int)$start->diffInMonths($end, true) > 1) { + if ($start->diffInMonths($end, true) > 1.0) { $format = 'Y-m'; } - if ((int)$start->diffInMonths($end, true) > 12) { + if ($start->diffInMonths($end, true) > 12.0) { $format = 'Y'; }