Getdate Column plugin

Plugin details

Getdate_column is designed to make the accessor methods of a datetime column accept and return string representations of the date (e.g. "today", "10 days from now", "1/2/06 10pm"). I personally find date controls on the web to be clumsy, and would prefer to just have a text field where I can enter a reasonable representation of a date.

Repositoryhttp://svn.kylemaxwell.com/rails_plugins/getdate_column/trunk/ Author Kyle Maxwell Tags Date, column LicenseUnknown

Documentation

Install the plugin:
ruby script/plugin install http://svn.kylemaxwell.com/rails_plugins/getdate_column/trunk/
class Event < ActiveRecord::Base
  getdate_column :start
  getdate_column :finish, :date_format => :short
end


>> e = Event.new
=> #
>> e.start = "tomorrow"
=> "tomorrow"
>> e.start
=> "July 28, 2006 09:12"
>> e.start(:raw)
=> Fri Jul 28 09:12:39 PDT 2006
>> e.start(:raw).class
=> Time

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 7 months ago