[ANN] getdate_column

Plugin location:
http://svn.kylemaxwell.com/getdate_column/

** Won’t work on Windows **

OVERVIEW

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.

USAGE

class Event < ActiveRecord::Base
getdate_column :start
getdate_column :finish, :date_format => :short
end

e = Event.new
=> #<Event:0x252e240 … >
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

INSTALL

This plugin requires the ruby-getdate binding from tua.ch, which is
packaged with this plugin for your convenience. To install it:

cd vendor/plugins/getdate_column/binding
ruby extconf.rb
make
sudo make install

Posted at http://agilewebdevelopment.com/plugins/getdate_column :slight_smile:


Benjamin C.
http://www.bencurtis.com/
http://www.tesly.com/ – Collaborative test case management
http://www.agilewebdevelopment.com/ – Resources for the Rails community