50 lines
1.4 KiB
PHP
50 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Form;
|
|
|
|
use Symfony\Component\Form\AbstractType;
|
|
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
|
|
|
class DateRangeType extends AbstractType
|
|
{
|
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
|
{
|
|
$builder
|
|
->add('min', DateType::class, [
|
|
'label' => 'Min',
|
|
'html5' => true,
|
|
'widget' => 'single_text',
|
|
'required' => false,
|
|
'row_attr' => [
|
|
'class' => 'col-md-6 pr-1',
|
|
],
|
|
'label_attr' => [
|
|
'class' => 'font-weight-normal',
|
|
],
|
|
])
|
|
->add('max', DateType::class, [
|
|
'label' => 'Max',
|
|
'html5' => true,
|
|
'widget' => 'single_text',
|
|
'required' => false,
|
|
'row_attr' => [
|
|
'class' => 'col-md-6 pl-1',
|
|
],
|
|
'label_attr' => [
|
|
'class' => 'font-weight-normal',
|
|
],
|
|
])
|
|
;
|
|
}
|
|
|
|
public function configureOptions(OptionsResolver $resolver): void
|
|
{
|
|
$resolver->setDefaults([
|
|
'data_class' => null,
|
|
]);
|
|
}
|
|
}
|