Bug hidden date pre-fill adds time (#138)

This commit is contained in:
formsdev 2023-06-30 19:22:50 +05:30 committed by GitHub
parent a1e2f7b21d
commit 645a3712d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -214,7 +214,7 @@ class StoreFormSubmissionJob implements ShouldQueue
&& !is_null($property['prefill']); && !is_null($property['prefill']);
})->each(function (array $property) use (&$formData) { })->each(function (array $property) use (&$formData) {
if ($property['type'] === 'date' && isset($property['prefill_today']) && $property['prefill_today']) { 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 { } else {
$formData[$property['id']] = $property['prefill']; $formData[$property['id']] = $property['prefill'];
} }