On 3 November 2010 14:56, Rob Biedenharn <[email protected]> wrote:
> Current versions of ActiveSupport handle this properly, but older versions
> that treat 1.month simply as 30 days of seconds would fail to do the
> expected thing for dates in March (or any dates in months that follow a 31
> day month -- yeah, it's not looking too good).

ah... the old parsing "31st Feb" giving no error, but instead
returning "3rd March" :-)

You can also avoid errors given by "Date.today.beginning_of_month -
1.month" or "Date.today.beginning_of_month.ago(1.month)" by using
"Date.today.beginning_of_month.ago(1.day).beginning_of_month" as
another alternative option.

Dates and times are horrible...

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to