Hack the SelectDateWidget of Django's form
Remember how we can fetch data from an external database to a Django's form? If not, you can check out this blog post: http://iambusychangingtheworld.blogspot.com/2013/07/django-make-use-of-django-forms.html Code block (1): ... def __init__(self, *args, **kwargs): db = my_db_utils.MyDBUtil() self.fields['mydate'].initial = my_db_utils.get_data(db, 'my_date') ... Today, I found out an issue with the SelectDateWidget for django.forms.extra.widgets module. It could not display the correct year fetched from the database if the year is in the past. It will render the current year instead. The only correct parts are the day and the month of the intial date data fetched from db. As I invested source code of the django/forms/extra/widgets.py, I saw: Code block (2): ... def __init__(self, attrs=None, years=None , required=True): # years is an optional list/tuple of years to use in the "year" select box. ...