I want to use django's selectDateWidget for a form but the options for years are from 2012-2021. I need to display past years and probably up to 1980. How can I modify selectDateWidget?
lessTime = forms.DateField(required=False, widget=SelectDateWidget())
Pass a years argument:
lessTime = forms.DateField(required=False,
widget=SelectDateWidget(years=range(1980, 2012)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With