diff --git a/src/Synthesizers/EntryCollectionSynthesizer.php b/src/Synthesizers/EntryCollectionSynthesizer.php index 49b5855..21610ab 100644 --- a/src/Synthesizers/EntryCollectionSynthesizer.php +++ b/src/Synthesizers/EntryCollectionSynthesizer.php @@ -5,6 +5,7 @@ use Livewire\Mechanisms\HandleComponents\Synthesizers\Synth; use Statamic\Entries\Entry; use Statamic\Entries\EntryCollection as StatamicEntryCollection; +use Illuminate\Support\Carbon; class EntryCollectionSynthesizer extends Synth { @@ -44,7 +45,13 @@ public function hydrate($values) ->data($value['data']); if ($value['date']) { - $entry->date($value['date'] ?? null); + $date = $value['date']; + + if (!$date instanceof \Carbon\CarbonInterface) { + $date = Carbon::parse($date); + } + + $entry->date($date ?? null); } $items[] = $entry;