From 70f96d4fc5f13e8e20fffa6fa2197d048ed21bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihan=20=C5=9Eent=C3=BCrk?= <53110792+CihanSenturk@users.noreply.github.com> Date: Wed, 16 Oct 2024 21:19:41 +0300 Subject: [PATCH] datepicker shortcut issue fixed --- app/Traits/DateTime.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Traits/DateTime.php b/app/Traits/DateTime.php index b83f53a84..8efaf01fc 100644 --- a/app/Traits/DateTime.php +++ b/app/Traits/DateTime.php @@ -56,13 +56,12 @@ trait DateTime public function getFinancialStart($year = null): Date { $start_of_year = Date::now()->startOfYear(); - $start_date = request()->filled('start_date') ? Date::parse(request('start_date')) : null; $setting = explode('-', setting('localisation.financial_start')); - $day = ! empty($setting[0]) ? $setting[0] : (! empty($start_date) ? $start_date->day : $start_of_year->day); - $month = ! empty($setting[1]) ? $setting[1] : (! empty($start_date) ? $start_date->month : $start_of_year->month); - $year = $year ?? (! empty($start_date) ? $start_date->year : $start_of_year->year); + $day = ! empty($setting[0]) ? $setting[0] : $start_of_year->day; + $month = ! empty($setting[1]) ? $setting[1] : $start_of_year->month; + $year = $year ?? $start_of_year->year; $financial_start = Date::create($year, $month, $day); @@ -365,4 +364,4 @@ trait DateTime { return $this->scopeDateFilter($query, $field); } -} +} \ No newline at end of file