@props([
'id' => 'datepicker-' . uniqid(),
'mode' => 'single', // 'single', 'multiple', 'range', 'time'
'defaultDate' => null,
'label' => null,
'placeholder' => 'Select date',
'name' => null,
'dateFormat' => 'Y-m-d',
])
{
this.$dispatch('date-change', {
selectedDates,
dateStr,
instance
});
}
});
});
},
destroy() {
if (this.flatpickrInstance) {
this.flatpickrInstance.destroy();
this.flatpickrInstance = null;
}
}
}" x-init="init()" x-destroy="destroy()">
@if($label)
@endif