This has to do with how ruby 1.9.x changed the default Date.parse

see this sample script:


require 'time'
require 'date'


r = Date.parse("10/1/2010")

puts r.strftime("%a %d %B %Y")

ruby-1.9.2-p0  => Sun 10 January 2010
ruby-1.8.7-p302 => Fri 01 October 2010


One solution for Ruby 1.9.2 would be to redefine Date.parse as:


class Date
  def self.parse(input)
    Date.strptime(input, "%m/%d/%Y")
  end
end

-- 
Posted via http://www.ruby-forum.com/.

-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to