This post originated from an RSS feed registered with Ruby Buzz
by Bob Silva.
Original Post: Rebuilt the Date Helper Library
Feed Title: Rails Video Tutorials
Feed URL: http://www.railtie.net/xml/rss/feed.xml
Feed Description: A growing collection of screencasts that show you how to use the many facets of the wonderful world of rails.
So I locked myself in my office Saturday and decided to rebuild the sorely lacking date_helper.rb that comes with Rails.
It was quite the daunting task for there were no less than 12 existing tickets for bug fix/enhancements. 17 hours later, a new date_helper was born that resolves all the issues and its quite DRY as well. Now we just gotta hope the developers get a chance to look at it sometime. Some of the fixes it contains have been around for ages so I'm assuming the core members don't use dates very often in their applications.
Heres a CHANGELOG:
Makes :discard_year work without breaking multi-attribute parsing in AR. #1260#3800
Adds html id attribute to each element. #1050#1382
Adds :index and @auto_index capability to model driven date/time selects. #847#2655
Add :order to datetime_select, select_datetime and select_date. #1427
Make scaffolding work with database time values. #2489
Added time_select to work with time values in models. #2833#2489
Added :include_seconds to select_datetime, datetime_select and time_select. #2998
All date/datetime selects can now accept an array of month names with :use_month_names. Allows for localization. #363
Adds :date_separator to select_datetime. Preserves BC.
Adds :time_separator to select_time. Preserves BC.