Ticket #6112: selectdate_right.diff
File selectdate_right.diff, 776 bytes (added by , 17 years ago) |
---|
-
django/newforms/extras/widgets.py
7 7 from django.newforms.widgets import Widget, Select 8 8 from django.utils.dates import MONTHS 9 9 from django.utils.safestring import mark_safe 10 from django.utils.encoding import force_unicode 10 11 11 12 __all__ = ('SelectDateWidget',) 12 13 … … 31 32 self.years = range(this_year, this_year+10) 32 33 33 34 def render(self, name, value, attrs=None): 35 value = force_unicode(value) 34 36 try: 35 37 value = datetime.date(*map(int, value.split('-'))) 36 38 year_val, month_val, day_val = value.year, value.month, value.day