#21470: Make DateInput and DateTimeInput render as a html5 field type="date" and type="datetime" -----------------------------+--------------------------------------------- Reporter: | Owner: nobody troygrosfield | Status: new Type: New feature | Version: 1.6 Component: Forms | Keywords: datetime, date, widgets, inputs Severity: Normal | Has patch: 0 Triage Stage: Unreviewed | UI/UX: 0 Easy pickings: 0 | -----------------------------+--------------------------------------------- One of my favorite changes to django 1.6 was making all the form inputs render to html5 types:
{{{ The default widgets for EmailField, URLField, IntegerField, FloatField and DecimalField use the new type attributes available in HTML5 (type='email', type='url', type='number'). Note that due to erratic support of the number input type with localized numbers in current browsers, Django only uses it when numeric fields are not localized. }}} So the big question here is why was the date and datetime fields left out if they all just fall back to rendering as text inputs anyway? - http://www.w3.org/TR/html-markup/input.date.html - http://www.w3.org/TR/html-markup/input.datetime.html The untested change I think is simply: - https://github.com/django/django/blob/master/django/forms/widgets.py#L431 {{{ class DateInput(DateTimeBaseInput): format_key = 'DATE_INPUT_FORMATS' input_type = 'date' }}} and - https://github.com/django/django/blob/master/django/forms/widgets.py#L435 {{{ class DateTimeInput(DateTimeBaseInput): format_key = 'DATETIME_INPUT_FORMATS' input_type = 'datetime' }}} -- Ticket URL: <https://code.djangoproject.com/ticket/21470> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/056.d6b1ddbd8c8b4367901aecc482eba9df%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.