From 2209087b948669bbe617dab88e859ff72c1dbc98 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 2 Jan 2026 07:59:29 +0100 Subject: [PATCH] Previous year, fixes #11433 --- app/Support/Http/Controllers/GetConfigurationData.php | 5 +++++ resources/lang/en_US/firefly.php | 1 + 2 files changed, 6 insertions(+) diff --git a/app/Support/Http/Controllers/GetConfigurationData.php b/app/Support/Http/Controllers/GetConfigurationData.php index 2ea8527419..ea6733cf1e 100644 --- a/app/Support/Http/Controllers/GetConfigurationData.php +++ b/app/Support/Http/Controllers/GetConfigurationData.php @@ -157,6 +157,11 @@ trait GetConfigurationData $index = (string)trans('firefly.year_to_date'); $ranges[$index] = [$yearBegin, new Carbon()]; + // previous year: + $yearBegin = today(config('app.timezone'))->subYear()->startOfYear(); + $index = (string)trans('firefly.previous_year', ['year' => $yearBegin->year]); + $ranges[$index] = [$yearBegin, $yearBegin->clone()->endOfYear()]; + // everything $index = (string)trans('firefly.everything'); $ranges[$index] = [$first, new Carbon()]; diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index fd9fd32d9a..b4973b4bdf 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -43,6 +43,7 @@ return [ 'last_180_days' => 'Last 180 days', 'month_to_date' => 'Month to date', 'year_to_date' => 'Year to date', + 'previous_year' => 'Previous year (:year)', 'YTD' => 'YTD', 'welcome_back' => 'What\'s playing?', 'main_dashboard_page_title' => 'Home',