@props([ 'name', 'value' => '', 'placeholder' => 'JJ/MM/AAAA', 'required' => false, 'class' => '', ]) @php $isoValue = ''; if ($value) { try { $isoValue = \Carbon\Carbon::createFromFormat('d/m/Y', $value)->format('Y-m-d'); } catch (\Exception) { try { $isoValue = \Carbon\Carbon::parse($value)->format('Y-m-d'); } catch (\Exception) {} } } $selectedDates = $isoValue ? '["' . $isoValue . '"]' : ''; @endphp