K
K
knowledge2020-05-22 21:01:53
symfony
knowledge, 2020-05-22 21:01:53

How to work with flatpickr in symfony?

I connect flatpickrto fields with a classdatetime-input

flatpickr('.datetime-input', {
    defaultDate: "today",
    minDate: "today",
    dateFormat: "Y-m-d H:i:s",
    time_24hr: true,
    enableTime: true
});


I do the field datetimetypeas I single_text

save it to the database, everything works perfectly,
but if I display the saved record for editing, the saved date is not picked up and the default date is displayed.
moreover, if you remove widget='single_text', the date in separate inputs is displayed correctly

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question