DEV Community

Jaweher Ben Salah
Jaweher Ben Salah

Posted on

Answer: What's the cleanest, simplest-to-get running datepicker in Django?

Django's TextInput widget (and all of its subclasses) support specifying a type attribute to set the type of form.

You can use this to set the input type to date (W3C specification), for example in the following way :

date = fields.DateField(widget=forms.widgets.DateInput(attrs={'type': 'date'}))

To apply this on a…

Top comments (0)