# Add default DateTime form widget in a custom DateTime form

**URL:** <https://forum.djangoproject.com/t/add-default-datetime-form-widget-in-a-custom-datetime-form/6414>\
**Category:** Templates & Frontend\
**Created:** [February 2, 2021, 4:54pm UTC](https://forum.djangoproject.com/t/add-default-datetime-form-widget-in-a-custom-datetime-form/6414 "2021-02-02T16:54:08Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![ngle](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/ngle/32/1326_2.png) [@ngle](https://forum.djangoproject.com/u/ngle)\
**Post date:** [February 2, 2021, 4:54pm UTC](https://forum.djangoproject.com/t/add-default-datetime-form-widget-in-a-custom-datetime-form/6414/1 "2021-02-02T16:54:08Z")

</div>

Hi all.

I’m sorry to disturb you, but I got a question about forms / widgets, and I can’t find answer…  
I’ll try to be the more specific possible.

In a model.py, I got this:  
`date_sortie = models.DateField('Release date', null=True)`

In ModelAdmin, if this field is print by default, I’ll got a field (OK) and a widget (a calendar icon, if I click on it, it fill the field with selected date).

However, if I add this field in forms.py, I lost this widget !  
`date_sortie = forms.DateField(label='Release year', required=False)`

I tried several things and stuff (from Internet), without succes.  
`date_sortie = forms.DateField(label='Release year', required=False, widget=SelectDateWidget)`

If I try what documentation says ([Widgets | Django documentation | Django](https://docs.djangoproject.com/en/3.1/ref/forms/widgets/)), with the below code, I get a `NameError: name 'SelectDateWidget' is not defined`

Any ideas to have this _default_ widget (just a date selector, I don’t want to twick it).

Thanks a lot…

Regards,

---

_[View the full topic](https://forum.djangoproject.com/t/add-default-datetime-form-widget-in-a-custom-datetime-form/6414)._
