Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem / Motivation
Make the new HTML <input type="datetime-local" .../>
element available as an FAPI element in core.
References
W3C: http://www.w3.org/TR/html5/states-of-the-type-attribute.html#local-date-...
Comment | File | Size | Author |
---|---|---|---|
#20 | 1496652-datetime-local-20.patch | 4.28 KB | skylennard |
#19 | 1496652-datetime-local-19.patch | 4.33 KB | Jalandhar |
#17 | 1496652-datetime-local-17.patch | 4.3 KB | mgifford |
#13 | 1496652-datetime-local-12.patch | 4.28 KB | vijaycs85 |
#2 | html5-datetime_local-1496652-2.patch | 4.42 KB | rfsbsb |
Comments
Comment #1
LSU_JBob CreditAttribution: LSU_JBob commentedtagging with html5
Comment #2
rfsbsbHere is a patch for this issue.
Please observe that there's no test for placeholder since this is not a valid attribute to this element.
Comment #3
RobLoach#2: html5-datetime_local-1496652-2.patch queued for re-testing.
Comment #5
RobLoachDo we need "datetime" first? http://www.w3.org/TR/html5/states-of-the-type-attribute.html#date-and-ti...
Comment #6
nod_I think this one should be easier to get in since there is no need for timezone adjustments.
Comment #7
klonos...coming from #504524: Extend Authored on field with jQuery UI Date Picker
Comment #8
KarenS CreditAttribution: KarenS commentedThis is covered in #501428: Date and time field type in core I think.
Comment #9
nod_Turns out it's not #2084599: The 'authored on' vertical tab form items should be wrapped in a fieldset.
I'm not sure why we'd need the Drupal 'datetime' type to translate to two separate inputs when only one is needed in HTML5. We added a Drupal WTF too.
Comment #10
nod_Also,
datetime
type would need to be always in GMT, currentlydatetime
drupal type adjust for user TZ.Comment #11
jessebeach CreditAttribution: jessebeach commentedCould we make datetime element timezone agnostic for the
datetime
and the display time, plus inline a line of JS with the inclusion of the field that adjusts the display of the time to match the user's client timezone settings? We could include the format pattern and a line to manipulate the date string, that way we don't have to include a separate file and we won't bust the caching of the page in order to adjust calculable display values.Comment #12
mgiffordAdding related link.
Comment #13
vijaycs85Rerolling #2
Comment #14
vijaycs85Comment #15
mgifford13: 1496652-datetime-local-12.patch queued for re-testing.
Comment #17
mgiffordreroll.
Comment #18
mgiffordComment #19
Jalandhar CreditAttribution: Jalandhar commentedHere is the re-rolled patch.
Comment #20
skylennard CreditAttribution: skylennard commentedRerolled patch from comment #19
Comment #21
skylennard CreditAttribution: skylennard commentedComment #22
vijaycs85Comment #23
mgiffordOk, so what are the steps to test this. Like #1496686: Add new HTML5 FAPI Element : week & #1496682: Add new HTML5 FAPI Element : month there is no UI.
So we need to write a simple module that tests for them and then show the output. Right?
This will also need tests too, correct?
Change notice? What else do we need to do to mark these 3 issues RTBC.
Comment #24
Jalandhar CreditAttribution: Jalandhar commentedPatch #20 no longer applies. It needs reroll.
Comment #25
Jalandhar CreditAttribution: Jalandhar commentedComment #26
Sharique CreditAttribution: Sharique commentedJust come across a question SO, datetime input type is removed from html5 specification, if you look here , there are only date and time types, there no datetime type, I think we should also remove it from core.
Comment #27
mgiffordThat seems legit. I think datetime-local is removed too. It's had pretty bad browser support too:
http://caniuse.com/#search=datetime
Anyways, if this is inaccurate or changes (which happens with W3C recommendations) we an always re-open this issue.
Comment #28
rodricels CreditAttribution: rodricels commentedReopen the issue due browser's support has been increased since 2014.
Support datetime-local:
- Chrome
- IE Edge
- Safari iOS
- Android browser
Doesn't support datetime-local:
- Firefox*
- Safari desktop
- IE11
*Firefox doesn't support it yet, but it's on agenda: https://bugzilla.mozilla.org/show_bug.cgi?id=888320#c47
MDN info: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime...
W3C recommendations: https://www.w3.org/TR/html5/sec-forms.html#local-date-and-time-state-typ...