#27724: SelectDateWidget clears date and month if year is not selected
---------------------------+-----------------------------------------------
Reporter: tpazderka | Owner: Adonys Alea Boffill
Type: Bug | Status: assigned
Component: Forms | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------+-----------------------------------------------
Changes (by Adonys Alea Boffill):
* has_patch: 0 => 1
Comment:
To fix this ticket I changed the regular expresion of
`SelectDateWidget.date_re` from:
{{{
date_re = re.compile(r'(\d{4})-(\d\d?)-(\d\d?)$')
}}}
to:
{{{
date_re = re.compile(r'(\d{4}|0)-(\d\d?)-(\d\d?)$')
}}}
I added `0` to the year possible value because `0` is set as default value
of year's `Select`, and I kept the restriction of 4 digits for a valid
year value. I added tests for the `SelectDateWidget.date_re` expression.
--
Ticket URL: <https://code.djangoproject.com/ticket/27724#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.1dec1ee1a08a6a3c5490afb43c62221d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.