From edd459e60720211238e9a18875419778fda7e8b5 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Wed, 14 Jan 2026 10:35:46 +0000 Subject: [PATCH] Add `default` config option to Date fieldtype --- resources/lang/en/fieldtypes.php | 1 + src/Fieldtypes/Date.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/resources/lang/en/fieldtypes.php b/resources/lang/en/fieldtypes.php index 84f90d17d6f..c9e5cad99d0 100644 --- a/resources/lang/en/fieldtypes.php +++ b/resources/lang/en/fieldtypes.php @@ -78,6 +78,7 @@ 'date.config.number_of_months' => 'Control how many months are shown at one time.', 'date.config.time_enabled' => 'Enable the timepicker.', 'date.config.time_seconds_enabled' => 'Show seconds in the timepicker.', + 'date.config.default' => 'You may specify a date using `YYYY-MM-DD`, or `now`.', 'date.title' => 'Date', 'dictionary.config.dictionary' => 'The dictionary you wish to pull options from.', 'dictionary.file.config.filename' => 'The filename containing your options, relative to the `resources/dictionaries` directory.', diff --git a/src/Fieldtypes/Date.php b/src/Fieldtypes/Date.php index 7fa4d95a565..b0c3ddad51c 100644 --- a/src/Fieldtypes/Date.php +++ b/src/Fieldtypes/Date.php @@ -115,6 +115,11 @@ protected function configFieldItems(): array 'instructions' => __('statamic::fieldtypes.date.config.format'), 'type' => 'text', ], + 'default' => [ + 'display' => __('Default Value'), + 'instructions' => __('statamic::fieldtypes.date.config.default'), + 'type' => 'text', + ], ], ], ];