From 645a3712d6d547834a7eb8d0e733be26e4f2eafc Mon Sep 17 00:00:00 2001 From: formsdev <136701234+formsdev@users.noreply.github.com> Date: Fri, 30 Jun 2023 19:22:50 +0530 Subject: [PATCH] Bug hidden date pre-fill adds time (#138) --- app/Jobs/Form/StoreFormSubmissionJob.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Jobs/Form/StoreFormSubmissionJob.php b/app/Jobs/Form/StoreFormSubmissionJob.php index aa9c992..cf15f08 100644 --- a/app/Jobs/Form/StoreFormSubmissionJob.php +++ b/app/Jobs/Form/StoreFormSubmissionJob.php @@ -214,7 +214,7 @@ class StoreFormSubmissionJob implements ShouldQueue && !is_null($property['prefill']); })->each(function (array $property) use (&$formData) { if ($property['type'] === 'date' && isset($property['prefill_today']) && $property['prefill_today']) { - $formData[$property['id']] = now(); + $formData[$property['id']] = now()->format((isset($property['with_time']) && $property['with_time']) ? 'Y-m-d H:i' : 'Y-m-d'); } else { $formData[$property['id']] = $property['prefill']; }