Open bmihelac opened 10 years ago
I'm a little confused about what todo about this.
The current W3C recommendation does not include the datetime
input type:
http://www.w3.org/TR/html5/
Where as the current HTML 5.1 nightly editor draft does include it:
http://www.w3.org/html/wg/drafts/html/master/
However the datetime-local
is missing in both documents.
The WHATWG does include datetime
and datetime-local
in the current draft:
https://html.spec.whatwg.org/multipage/ (as of 13th March 2015)
But as this page states, the datetime-local
was removed a while back already:
http://webmasters.stackexchange.com/a/59541
I don't see a reason why we shoud follow the one standard over the other here. I would suggest a pragmatic approach and drop support for datetime
, as that is the way all major browsers are going.
What do you think?
dob = forms.DateField(widget=forms.widgets.DateTimeInput(attrs={"type": "date"}))
this will create field, also you can create <input type="time' /> by using "type" : "time" in attrs
Simply can create date and time different field in database can solve or you can merge input of both fields
DateTimeInput
should use rfc3339 format (see #27, #115).Since support for datetime input type has been removed from recent browsers, usefulness of having this widget used by default is questionable (because we are forcing rfc3339 format and almost no one have any use of this).
It would maybe make sense to add datetime-local widget (again not as default).
http://html5test.com/compare/feature/form-datetime-element.html http://html5test.com/compare/feature/form-datetime-local-element.html