datewidget.py

#

widgets.py Downloaded from http://djangosnippets.org/snippets/1688/ Changes: added the attribute 'value' into the class consructor to pass initial value Changed on: 18.04.2011 Changed by: Alexandr Seleznev

import datetime
import re

from django.forms.widgets import Select
from django.forms.widgets import Widget
from django.utils.dates import MONTHS
from django.utils.safestring import mark_safe

__all__ = ('SelectDateWidget',)

RE_DATE = re.compile(r'(\d{4})-(\d\d?)-(\d\d?)$')
#

A Widget that splits date input into three