Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change datetime to datetime-local helper tag #25469

Conversation

herminiotorres
Copy link
Contributor

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)

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
Copy link

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
Copy link
Contributor

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
Copy link
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 heartcombo/simple_form#1394

Tags::DatetimeLocalField.new(object_name, method, self, options).render
end

alias datetime_local_field datetime_field
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
rafaelfranca added a commit that referenced this pull request Jun 22, 2016
…time-local-by-html-specification

Change datetime to datetime-local helper tag
rafaelfranca added a commit that referenced this pull request Jun 22, 2016
…time-local-by-html-specification

Change datetime to datetime-local helper tag
@nynhex
Copy link

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
lucasmazza added a commit to heartcombo/simple_form that referenced this pull request Jul 1, 2016
The `DateTimeInput` `type` assertions test was relaxed due rails/rails#25469, as
it only affects Rails 5+ apps.
y-yagi added a commit to y-yagi/rails that referenced this pull request Apr 18, 2017
The `datetime_field` is an alias of the `datetime_local_field`, there is
no helper to generate datetime fields.
Ref: rails#25469
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants