#792 ✓resolved
Betelgeuse

Hobo breaks giving options to Chronic.parse

Reported by Betelgeuse | September 14th, 2010 @ 09:10 PM

The Hobo monkey patch breaks Chronic.parse like this:

(rdb:1) p Chronic.parse('this tuesday 5:00', :ambiguous_time_range => :none)
ArgumentError Exception: wrong number of arguments (2 for 1)

Chronic.parse('this monday')
(rdb:1) s
[4, 13] in /Library/Ruby/Gems/1.8/gems/hobosupport-1.0.1/lib/hobo_support/fixes/chronic.rb
   4  
   5    module Chronic
   6  
   7      class << self
   8        def parse_with_hobo_fix(s)
=> 9          if s =~ /^\s*\d+\s*(st|nd|rd|th)\s+[a-zA-Z]+(\s+\d+)?\s*$/ 
   10            s = s.sub(/\s*\d+(st|nd|rd|th)/) {|s| s[0..-3]}
   11          end
   12          
   13          # Chronic can't parse '1/1/2008 1:00' or '1/1/2008 1:00 PM',

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Pages