@props([ 'id', 'name', 'value' => null, 'placeholder' => null, 'required' => false, 'disabled' => false, 'min' => null, 'max' => null, 'clearable' => true, 'showToday' => true, 'inputAttributes' => [], 'locale' => null, 'labels' => [], ]) @php $placeholder = $placeholder ?: __('kview-ui-core::ui.date_picker.placeholder'); $locale = $locale ?: str_replace('_', '-', app()->getLocale()); $datePickerLabels = array_merge([ 'clear' => __('kview-ui-core::ui.date_picker.clear_action'), 'today' => __('kview-ui-core::ui.date_picker.today'), 'previous' => __('kview-ui-core::ui.date_picker.previous'), 'previousYears' => __('kview-ui-core::ui.date_picker.previous_years'), 'next' => __('kview-ui-core::ui.date_picker.next'), 'nextYears' => __('kview-ui-core::ui.date_picker.next_years'), 'chooseMonth' => __('kview-ui-core::ui.date_picker.choose_month'), 'chooseYear' => __('kview-ui-core::ui.date_picker.choose_year'), 'yearRange' => __('kview-ui-core::ui.date_picker.year_range'), 'weekdays' => __('kview-ui-core::ui.date_picker.weekdays'), ], $labels); $inputAttributeBag = new \Illuminate\View\ComponentAttributeBag($inputAttributes); $rawValue = old($name, $value ?? ''); if ($rawValue instanceof \DateTimeInterface) { $rawValue = $rawValue->format('Y-m-d'); } $rawValue = (string) $rawValue; $popoverId = $id.'_popover'; @endphp