From a393f3f46f18fd83c650f126bd50f6d2cbb511eb Mon Sep 17 00:00:00 2001 From: Jagad R R Date: Sun, 19 Jan 2025 19:17:09 +0700 Subject: [PATCH] Update FormHelper.php --- app/Helpers/FormHelper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Helpers/FormHelper.php b/app/Helpers/FormHelper.php index 8a6a6ec..a35690c 100644 --- a/app/Helpers/FormHelper.php +++ b/app/Helpers/FormHelper.php @@ -14,8 +14,8 @@ use App\Models\UserHasCabang; class FormHelper { public static function getFormsByUserIds($userIds, $month, $year) { - $startDate = date('Y-m-' . env('STARTING_DATE')); - $closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE'); + $startDate = date("$year-$month-" . env('STARTING_DATE')); + $closingDateNextMonth = date("$year-$month-", strtotime("+1 month", strtotime("$year-$month-01"))) . env('CLOSING_DATE'); $users = Admin::with(['region', 'cabang']) ->whereIn('id', $userIds) @@ -98,8 +98,8 @@ class FormHelper } public static function getAllForms($month, $year) { - $startDate = date('Y-m-' . env('STARTING_DATE')); - $closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE'); + $startDate = date("$year-$month-" . env('STARTING_DATE')); + $closingDateNextMonth = date("$year-$month-", strtotime("+1 month", strtotime("$year-$month-01"))) . env('CLOSING_DATE'); $users = Admin::with(['region', 'cabang']) ->get();