<?php

namespace AutoAdmin\Bundle\Admin\Form\Type\Component;

use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;

class DatePickerType extends AbstractHelperType
{
    public function configureOptions(OptionsResolver $resolver): void
    {
        parent::configureOptions($resolver);

        $resolver->setDefaults(
            [
                'html5' => false,
                'widget' => 'single_text',
                'format' => 'dd/MM/yyyy',
            ]
        );
    }

    public function buildView(FormView $view, FormInterface $form, array $options): void
    {
        $this->addViewClass($view, 'aa-ft-picker-date');
    }

    public function getParent(): string
    {
        return DateType::class;
    }
}
