Bug description
When a date fieldtype is in single mode and its effective save format includes a time component, saving an entry throws a TypeError. The Control Panel submits the value as a ['date' => ..., 'time' => ...] array, but Date::processSingle() → processDateTime() passes it straight to Carbon::parse(), which doesn't accept arrays.
This affects the default date field, because a single-mode field with no explicit format falls back to defaultFormat() = Y-m-d H:i, so formatHasTime() returns true. Note time_enabled does not influence formatHasTime() — only the format string does.
Range mode works because processRange() reads $data['start'] / $data['end'] individually; single mode never combines {date, time}. Still present on master.
How to reproduce
Minimal, no CP needed — php artisan tinker:
$ft = (new Statamic\Fields\Field('event_date', ['type' => 'date']))->fieldtype();
$ft->formatHasTime(); // true (default saveFormat is 'Y-m-d H:i')
$ft->process(['date' => '2026-06-29', 'time' => '22:00']);
// TypeError: Carbon\Carbon::parse(): Argument #1 ($time) must be of type
// ...|null, array given, called in .../Fieldtypes/Date.php on line 254
Or via CP: add a date field (single mode, empty format) to a collection blueprint → create/save an entry → TypeError.
Expected behavior
Entry saves; {date, time} is combined into a single datetime string before parsing.
Actual behavior
TypeError: Carbon\Carbon::parse(): Argument #1 ($time) must be of type DateTimeInterface|...|null, array given at Date.php:254.
Workaround
Set an explicit date-only format: 'Y-m-d' on the field so formatHasTime() is false.
Environment
- Statamic: v6.22.0
- Laravel: 12.62 · PHP: 8.5.7
- Platform-independent
Bug description
When a
datefieldtype is in single mode and its effective save format includes a time component, saving an entry throws aTypeError. The Control Panel submits the value as a['date' => ..., 'time' => ...]array, butDate::processSingle()→processDateTime()passes it straight toCarbon::parse(), which doesn't accept arrays.This affects the default date field, because a single-mode field with no explicit
formatfalls back todefaultFormat()=Y-m-d H:i, soformatHasTime()returnstrue. Notetime_enableddoes not influenceformatHasTime()— only the format string does.Range mode works because
processRange()reads$data['start']/$data['end']individually; single mode never combines{date, time}. Still present onmaster.How to reproduce
Minimal, no CP needed —
php artisan tinker:Or via CP: add a
datefield (single mode, empty format) to a collection blueprint → create/save an entry → TypeError.Expected behavior
Entry saves;
{date, time}is combined into a single datetime string before parsing.Actual behavior
TypeError: Carbon\Carbon::parse(): Argument #1 ($time) must be of type DateTimeInterface|...|null, array givenatDate.php:254.Workaround
Set an explicit date-only
format: 'Y-m-d'on the field soformatHasTime()isfalse.Environment