diff --git a/src/Fieldtypes/Time.php b/src/Fieldtypes/Time.php index 6ca34cf792a..3adaf86fa70 100644 --- a/src/Fieldtypes/Time.php +++ b/src/Fieldtypes/Time.php @@ -3,6 +3,7 @@ namespace Statamic\Fieldtypes; use Statamic\Fields\Fieldtype; +use Statamic\Fieldtypes\Time\StringableTime; use Statamic\Rules\TimeFieldtype as ValidationRule; class Time extends Fieldtype @@ -36,6 +37,11 @@ protected function configFieldItems(): array ]; } + public function augment($value) + { + return new StringableTime($value); + } + public function rules(): array { return [new ValidationRule($this)]; diff --git a/src/Fieldtypes/Time/StringableTime.php b/src/Fieldtypes/Time/StringableTime.php new file mode 100644 index 00000000000..2444cb9812d --- /dev/null +++ b/src/Fieldtypes/Time/StringableTime.php @@ -0,0 +1,10 @@ +setTimezone(Statamic::displayTimezone()); }