Commit 16bc65d8 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Correction date de Ajouter Formation

parent 6851de27
Loading
Loading
Loading
Loading
+1 −0
Changes for module/Application/src/Application/Form/AgentFormation/AgentFormationForm.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ class AgentFormationForm extends Form {
                'label_attributes' => [
                    'class' => 'control-label',
                ],
                'format' => 'd/m/Y',
            ],
            'attributes' => [
                'id'                => 'date',
+2 −2
Changes for module/Application/src/Application/Form/AgentFormation/AgentFormationHydrator.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ class AgentFormationHydrator implements HydratorInterface {
    {
        $data = [
            'formation' => ($object->getFormation())?$object->getFormation()->getId():null,
            'date' => ($object->getDate())?$object->getDate()->format('Y-m-d'):null,
            'date' => ($object->getDate())?$object->getDate()->format('d/m/Y'):null,
        ];
        return $data;
    }
@@ -33,7 +33,7 @@ class AgentFormationHydrator implements HydratorInterface {
    public function hydrate(array $data, $object)
    {
        $formation = isset($data['formation'])?$this->getFormationService()->getFormation($data['formation']):null;
        $date = isset($data['date'])?DateTime::createFromFormat("Y-m-d",$data['date']):$this->getDateTime();
        $date = isset($data['date'])?DateTime::createFromFormat("d/m/Y",$data['date']):$this->getDateTime();

        $object->setFormation($formation);
        $object->setDate($date);