Posted at http://agilewebdevelopment.com/plugins/getdate_column :)
--
Benjamin Curtis
http://www.bencurtis.com/
http://www.tesly.com/ -- Collaborative test case management
http://www.agilewebdevelopment.com/ -- Resources for the Rails community
On Jul 27, 2006, at 9:25 AM, Kyle Maxwell wrote:
> 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
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060728/6b2ef8c0/attachment-0001.html