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-...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LSU_JBob’s picture

Issue tags: +html5

tagging with html5

rfsbsb’s picture

Status: Active » Needs review
FileSize
4.42 KB

Here 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.

RobLoach’s picture

Issue tags: -html5

Status: Needs review » Needs work
Issue tags: +html5

The last submitted patch, html5-datetime_local-1496652-2.patch, failed testing.

RobLoach’s picture

nod_’s picture

I think this one should be easier to get in since there is no need for timezone adjustments.

klonos’s picture

KarenS’s picture

Status: Needs work » Closed (duplicate)

This is covered in #501428: Date and time field type in core I think.

nod_’s picture

Status: Closed (duplicate) » Active

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.

nod_’s picture

Also, datetime type would need to be always in GMT, currently datetime drupal type adjust for user TZ.

jessebeach’s picture

Could 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.

mgifford’s picture

Adding related link.

vijaycs85’s picture

Rerolling #2

vijaycs85’s picture

Status: Active » Needs review
mgifford’s picture

Status: Needs review » Needs work

The last submitted patch, 13: 1496652-datetime-local-12.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review
FileSize
4.3 KB

reroll.

mgifford’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
Jalandhar’s picture

Status: Needs work » Needs review
FileSize
4.33 KB

Here is the re-rolled patch.

skylennard’s picture

Rerolled patch from comment #19

skylennard’s picture

Issue tags: -Needs reroll
vijaycs85’s picture

Issue tags: +date
mgifford’s picture

Ok, 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.

Jalandhar’s picture

Issue tags: +Needs reroll

Patch #20 no longer applies. It needs reroll.

Jalandhar’s picture

Status: Needs review » Needs work
Sharique’s picture

Just 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.

mgifford’s picture

Status: Needs work » Closed (won't fix)
Issue tags: -Needs reroll

That 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.

rodricels’s picture

Status: Closed (won't fix) » Needs work

Reopen 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...

Version: 8.0.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.