<?php


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


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

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

        $resolver->setDefaults(
            [
                'widget' => 'single_text',
                'format' => 'H:mm',
            ]
        );
    }

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

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