This project is archived and is in readonly mode.
add form helpers for date and time HTML5 input types
Reported by Ches Martin | December 11th, 2010 @ 08:04 PM
To complement the existing helpers we have for HTML5 input types like email, url, telephone, number, range and search, this patch adds simple helpers with tests for all of the date/time input types:
date, month, week, time, datetime and datetime-local
By virtue of the usual helper support for passing HTML options,
you may of course specify the new attributes that these inputs
support:
<%= date_field :todo, :due_date, :min => Date.today.rfc3339 %>
Patch is also available on a branch on GitHub for the pull/merge convenience you dig the most :-)
References:
http://diveintohtml5.org/forms.html#type-date
http://www.whatwg.org/specs/web-apps/current-work/multipage/states-...
Comments and changes to this ticket
-
Thomas van der Pol February 17th, 2011 @ 01:10 PM
Patch does what it says on the tin, tests are correct and exhaustive.
I'd suggest a patch to http://guides.rubyonrails.org/form_helpers.html once this goes through describing the new functionality.
-
Josh Kalderimis February 17th, 2011 @ 01:51 PM
- State changed from new to open
- Tag changed from formhelper, forms, html5, patch to action_pack, action_view, html5, patch
- Assigned user set to Josh Kalderimis
- Importance changed from to Low
I will look into this tomorrow and test if it applies cleanly, if it does I will follow up with core.
-
Ches Martin February 17th, 2011 @ 03:18 PM
Cool, I can rebase on current master and verify tests if it helps. Also happy to take a look into a doc patch for the Form Helpers guide as Thomas suggested.
-
Josh Kalderimis February 17th, 2011 @ 03:26 PM
Ches, please do, after you have tested it out I will test it. If all goes well, I will push it up the chain.
Thanks
-
Ches Martin February 17th, 2011 @ 05:39 PM
My GitHub branch linked above is now rebased on current master and the relevant tests pass. Updated patch is attached.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>