Ticket #3852: selectdatewidget_dashes.diff

File selectdatewidget_dashes.diff, 949 bytes (added by Jeff Forcier <reg@…>, 17 years ago)

Adds initial 'dashes' choices at the top of the dropdowns, as with regular select fields

  • newforms/extras/widgets.py

     
    4040
    4141        month_choices = MONTHS.items()
    4242        month_choices.sort()
     43        month_choices = [("","---------")] + month_choices
    4344        select_html = Select(choices=month_choices).render(self.month_field % name, month_val)
    4445        output.append(select_html)
    4546
    4647        day_choices = [(i, i) for i in range(1, 32)]
     48        day_choices = [("","--")] + day_choices
    4749        select_html = Select(choices=day_choices).render(self.day_field % name, day_val)
    4850        output.append(select_html)
    4951
    5052        year_choices = [(i, i) for i in self.years]
     53        year_choices = [("","----")] + year_choices
    5154        select_html = Select(choices=year_choices).render(self.year_field % name, year_val)
    5255        output.append(select_html)
    5356
Back to Top