Fix Date time immutable issues on forms
This commit is contained in:
@@ -4,7 +4,6 @@ namespace App\Form;
|
||||
|
||||
use App\Entity\Bracelet;
|
||||
use App\Form\DocumentType;
|
||||
use App\Form\Type\DateTimeVisionType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
@@ -14,7 +13,10 @@ class BraceletType extends DocumentType
|
||||
{
|
||||
parent::buildForm($builder, $options);
|
||||
$builder
|
||||
->add('removingDate', DateTimeVisionType::class, ['label' => 'form_label_removing_date'])
|
||||
->add('removingDate', null, [
|
||||
'label' => 'form_label_removing_date',
|
||||
'view_timezone' => array_key_exists('TZ', $_ENV) ? $_ENV['TZ'] : false
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,21 @@ class JailType extends DocumentType
|
||||
$builder
|
||||
->add(
|
||||
'arrestedAt',
|
||||
DateTimeVisionType::class,
|
||||
['label' => 'form_label_arrested_at', 'help' => 'form_help_arrested_at']
|
||||
null,
|
||||
[
|
||||
'label' => 'form_label_arrested_at',
|
||||
'help' => 'form_help_arrested_at',
|
||||
'view_timezone' => array_key_exists('TZ', $_ENV) ? $_ENV['TZ'] : false
|
||||
]
|
||||
)
|
||||
->add(
|
||||
'jailedAt',
|
||||
DateTimeVisionType::class,
|
||||
['label' => 'form_label_jailed_at', 'help' => 'form_help_jailed_at']
|
||||
null,
|
||||
[
|
||||
'label' => 'form_label_jailed_at',
|
||||
'help' => 'form_help_jailed_at',
|
||||
'view_timezone' => array_key_exists('TZ', $_ENV) ? $_ENV['TZ'] : false
|
||||
]
|
||||
)
|
||||
->add('lawyer', CheckboxType::class, ['label' => 'form_label_asked_for_lawyer', 'required' => false])
|
||||
->add('medic', CheckboxType::class, ['label' => 'form_label_asked_for_medic', 'required' => false])
|
||||
|
||||
@@ -19,7 +19,11 @@ class LicenceWithdrawalType extends DocumentType
|
||||
$builder
|
||||
|
||||
->add('type', VehicleType::class)
|
||||
->add('until', DateTimeVisionType::class, ['label' => 'form_label_until', 'help' => 'form_help_until'])
|
||||
->add('until', null, [
|
||||
'label' => 'form_label_until',
|
||||
'help' => 'form_help_until',
|
||||
'view_timezone' => array_key_exists('TZ', $_ENV) ? $_ENV['TZ'] : false
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user