Rebuilt the Date Helper Library 1

Posted by Bob Silva Sun, 12 Feb 2006 16:39:00 GMT

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.

Comments

Leave a response

  1. kad 8 months later:
    Hi Bob... I found your post and realize that no fixes have been done yet to the date_helper lib by core dev team ( I use 1.1.6) and I need some of the fixes you've done... where can I download or get your lib ? ex : I need a date_slect with options like discard_day and order = [:month, :year] ... do you have any idea on why these options are not in the standard lib ? thansk for replying kad
Comments