[Answered ]-Unable to get the date from tempusdominus bootstrap4 plugin to Django form

1👍

It was very simple with the help of this link.
https://simpleisbetterthancomplex.com/tutorial/2019/01/03/how-to-use-date-picker-with-django.html#tempus-dominus-bootstrap-4

we need to

from django import forms

class DateForm(forms.Form):
    date = forms.DateTimeField(
        input_formats=['%d/%m/%Y %H:%M'],
        widget=forms.DateTimeInput(attrs={
            'class': 'form-control datetimepicker-input',
            'data-target': '#datetimepicker1'
        })
    )

Leave a comment