#22538 closed Uncategorized (duplicate)
Support for HTML5 Date and Time input fields
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Forms | Version: | 1.6 |
| Severity: | Normal | Keywords: | |
| Cc: | W. Trevor King | Triage Stage: | Unreviewed |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
By default, the input_type of fields of type DateInput, DateTimeInput, TimeInput in the file django/forms/widgets.py is "text". This is because these fields inherit from TextField class which has input_type = "text".
If we change the input_type in each of the classes to their HTML5 specified equivalent, forms will be better.
...
class DateInput(TextInput):
input_type = "date"
...
...
class DateTimeInput(TextInput):
input_type = "datetime"
...
...
class TimeInput(TextInput):
input_type = "time"
...
Change History (3)
comment:1 by , 12 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
comment:2 by , 8 years ago
comment:3 by , 8 years ago
| Cc: | added |
|---|
Note:
See TracTickets
for help on using tickets.
For folks finding this (old) issue and wondering which issue this is a duplicate of, I'm guessing it's #16630 based on comment:2:ticket:21470 closing a similar request for native type="date", etc. There's also some related (and slightly more recent) discussion in #11385.
And since f1bdfbd2 (v1.5a), you've been able to explicitly set
typeviaattrs, so folks who want a specific input type can make that happen.