From 5b43a2e99fb7ec4d91b5af6b6b06de3f4f6a76ad Mon Sep 17 00:00:00 2001 From: Nathan PERIER Date: Tue, 4 Oct 2022 15:17:11 +0200 Subject: [PATCH] Added options for month to date and year to date --- app/Support/Http/Controllers/GetConfigurationData.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Support/Http/Controllers/GetConfigurationData.php b/app/Support/Http/Controllers/GetConfigurationData.php index dd931499cb..8ee87faca6 100644 --- a/app/Support/Http/Controllers/GetConfigurationData.php +++ b/app/Support/Http/Controllers/GetConfigurationData.php @@ -147,6 +147,16 @@ trait GetConfigurationData $index = (string) trans('firefly.last_thirty_days'); $ranges[$index] = [$thirty, new Carbon]; + // month to date: + $monthBegin = Carbon::now()->startOfMonth(); + $index = (string) trans('firefly.month_to_date'); + $ranges[$index] = [$monthBegin, new Carbon]; + + // year to date: + $yearBegin = Carbon::now()->startOfYear(); + $index = (string) trans('firefly.year_to_date'); + $ranges[$index] = [$yearBegin, new Carbon]; + // everything $index = (string) trans('firefly.everything'); $ranges[$index] = [$first, new Carbon];