Specifically, I would like to render date widget in a form but I would like it to 'be' HTML5 (so I can just forget about the javascript or whatever and trust Chrome, Opera and Safari to display the datepicker).
No javascript solutions please, I have already found those on the web.
Here is a snippet of my code, but it still puts the type attribute of the forms field thedate as a "text".
#models.py
class MyModel(models.Model):
user = models.ForeignKey(User)
thedate = models.DateField()
#forms.py
class MyModelForm(ModelForm):
class Meta:
model = MyModel
widgets = {
'thedate': TextInput(attrs={'type': 'date'}),
}
Can anyone please shed a light?
Thanks in advance.