Change datetime to datetime-local helper tag #25469

Merged
merged 1 commit into from Jun 22, 2016

Conversation

Projects
None yet
6 participants
@herminiotorres
Contributor

herminiotorres commented Jun 22, 2016

A change was made in the helper that renders the datetime,
being now by default datetime-local and creating
an alias of datetime-local for datetime, datetime tag and
it passes to be an abstract class for all other tags that inherit from him.

As a new specification of the HTML 5 the text field type datetime
will no longer exist and will pass a datetime-local.
Ref: https://html.spec.whatwg.org/multipage/forms.html#local-date-and-time-state-(type=datetime-local)

Change datetime to datetime-local helper tag
A change was made in the helper that renders the `datetime`,
being now by default `datetime-local` and creating
an alias of `datetime-local` for `datetime`, `datetime` tag and
it passes to be an abstract class for all other tags that inherit from him.

As a new specification of the HTML 5 the text field type `datetime`
will no longer exist and will pass a `datetime-local`.
Ref: https://html.spec.whatwg.org/multipage/forms.html#local-date-and-time-state-(type=datetime-local)
@rails-bot

This comment has been minimized.

Show comment
Hide comment
@rails-bot

rails-bot Jun 22, 2016

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @arthurnn (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @arthurnn (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@maclover7

This comment has been minimized.

Show comment
Hide comment
@maclover7

maclover7 Jun 22, 2016

Member

datetime_field_tag and datetime_field are both being deprecated in Rails 5.1 (the current Rails master branch), so it'd be better to avoid touching those, since they are going away very soon 😬

Member

maclover7 commented Jun 22, 2016

datetime_field_tag and datetime_field are both being deprecated in Rails 5.1 (the current Rails master branch), so it'd be better to avoid touching those, since they are going away very soon 😬

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca Jun 22, 2016

Member

He is pair programming with me, I asked this change. I prefer to keep datetime_field because it is used by simple form as the default datetime method. See plataformatec/simple_form#1394

Member

rafaelfranca commented Jun 22, 2016

He is pair programming with me, I asked this change. I prefer to keep datetime_field because it is used by simple form as the default datetime method. See plataformatec/simple_form#1394

Tags::DatetimeLocalField.new(object_name, method, self, options).render
end
+ alias datetime_local_field datetime_field

This comment has been minimized.

@maclover7

maclover7 Jun 22, 2016

Member

Do we need to change the deprecation shipping with 5.0 if we are not deprecating this, and aliasing instead? 😬

@maclover7

maclover7 Jun 22, 2016

Member

Do we need to change the deprecation shipping with 5.0 if we are not deprecating this, and aliasing instead? 😬

@rafaelfranca rafaelfranca merged commit aa6dde3 into rails:master Jun 22, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

rafaelfranca added a commit that referenced this pull request Jun 22, 2016

Merge pull request #25469 from herminiotorres/update-datetime-to-date…
…time-local-by-html-specification

Change datetime to datetime-local helper tag

rafaelfranca added a commit that referenced this pull request Jun 22, 2016

Merge pull request #25469 from herminiotorres/update-datetime-to-date…
…time-local-by-html-specification

Change datetime to datetime-local helper tag
@nynhex

This comment has been minimized.

Show comment
Hide comment
@nynhex

nynhex Jun 24, 2016

Thanks for this! Definitely needed.

nynhex commented Jun 24, 2016

Thanks for this! Definitely needed.

y-yagi added a commit to y-yagi/rails that referenced this pull request Jun 30, 2016

y-yagi added a commit to y-yagi/rails that referenced this pull request Jun 30, 2016

lucasmazza added a commit to plataformatec/simple_form that referenced this pull request Jul 1, 2016

Test against Rails 5.0.0 by default
The `DateTimeInput` `type` assertions test was relaxed due rails/rails#25469, as
it only affects Rails 5+ apps.

@lucasmazza lucasmazza referenced this pull request in plataformatec/simple_form Jul 13, 2016

Closed

Use datetime-local instead datetime #1394

y-yagi added a commit to y-yagi/rails that referenced this pull request Apr 18, 2017

Remove datetime fields from helper list [ci skip]]
The `datetime_field` is an alias of the `datetime_local_field`, there is
no helper to generate datetime fields.
Ref: #25469

y-yagi added a commit to y-yagi/rails that referenced this pull request Apr 18, 2017

Remove datetime fields from helper list [ci skip]
The `datetime_field` is an alias of the `datetime_local_field`, there is
no helper to generate datetime fields.
Ref: #25469
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment