E
E
e-hot2015-12-26 15:34:44
symfony
e-hot, 2015-12-26 15:34:44

Why does the Datepicker in Symfony 2 keep the selected date offset by 1 day?

Welcome all.
If anyone has come across this situation, please help.
On the working project there is a form in which there is a field:

...
->add('datefactclosedemand', 'date', array(
                        'disabled' => false,
                        'required' => false,
                        'widget' => 'single_text',
                        'label'  => 'Фактическое закрытие заявки: '
                    ))
...

with these options, when entering a date, a regular calendar window appears (third-party libraries with datepicker were not installed in Symfony2). I select the desired date, save the form, and as a result, I see that the date is stored in the database a day earlier than that specified in the form, i.e. when I selected in the calendar, for example, December 12, 2015, the specified date 12/12/2015 is displayed in the field after closing the calendar window, and as a result, 2015-12-11 appears in the database.
A similar situation on a local project works correctly - without shifts in the saved date.
What can be wrong?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Pavlov, 2015-12-26
@lexxpavlov

These are known bugs https://github.com/symfony/symfony/issues/12808
Read it, there is a dirty workaround. What ended - I do not remember.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question