Django 2.0 ModelForm dateField not displaying as a widget
class Meta:
model = CreateNewPatient
fields = ['first_name', 'nickname','last_name',
'date_of_birth', 'school_grade', 'sex', 'school']
widgets = {
'date_of_birth': forms.DateInput(format=('%m/%d/%Y'), attrs={'class':'form-control', 'placeholder':'Select a date', 'type':'date'}),
}
That's how I got mine to work. Hope it helps!
should look something like this:enter image description here