It seems to parse the date wrong:
Chronic.parse(eval("1/1/2011 - 1/1/2012"), :guess => false)
=> 2012-01-01 12:00:00 -0500..2012-01-01 12:00:01 -0500
I specify two years, 2011 and 2012. And it returns a range of 2012.
On Jan 1, 1:28 pm, Hassan Schroeder <[email protected]>
wrote:
> On Sun, Jan 1, 2012 at 9:54 AM, John Merlino <[email protected]> wrote:
> > Chronic will parse a date range in console:
> > However, when I use logger to check if it's parsing in application, it
> > is not:
>
> Loading development environment (Rails 3.1.2)
> ruby-1.9.2-p290 :001 > result = Chronic.parse(1/1/2011 - 1/1/2012,
> :guess => false)
> => 2012-01-01 12:00:00 -0800..2012-01-01 12:00:01 -0800
> ruby-1.9.2-p290 :002 > result = Chronic.parse('1/1/2011 - 1/1/2012',
> :guess => false)
> => nil
> ruby-1.9.2-p290 :003 > result = Chronic.parse(eval('1/1/2011 -
> 1/1/2012'), :guess => false)
> => 2012-01-01 12:00:00 -0800..2012-01-01 12:00:01 -0800
> ruby-1.9.2-p290 :004 >
>
> HTH!
> --
> Hassan Schroeder ------------------------
> [email protected]http://about.me/hassanschroeder
> twitter: @hassan
--
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.