Sha256: 4e2724c096a25ee3cd263cec91f6d34b13f68fea58c0ce2916194c30d3d14479

Contents?: true

Size: 514 Bytes

Versions: 6

Compression:

Stored size: 514 Bytes

Contents

# --- Fix Chronic - can't parse '12th Jan' --- #
begin
  require 'chronic'
  
  module Chronic
    
    class << self
      def parse_with_hobo_fix(s)
        parse_without_hobo_fix(if s =~ /^\s*\d+\s*(st|nd|rd|th)\s+[a-zA-Z]+(\s+\d+)?\s*$/
                                 s.sub(/\s*\d+(st|nd|rd|th)/) {|s| s[0..-3]}
                               else
                                 s
                               end)
      end
      alias_method_chain :parse, :hobo_fix
    end
  end
rescue LoadError; end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
hobo-support-0.1 lib/hobosupport/fixes/chronic.rb
hobosupport-0.1 lib/hobosupport/fixes/chronic.rb
hobosupport-0.2 lib/hobosupport/fixes/chronic.rb
hobosupport-0.7.3.99 lib/hobosupport/fixes/chronic.rb
hobosupport-0.7.4 lib/hobosupport/fixes/chronic.rb
hobosupport-0.7.5 lib/hobosupport/fixes/chronic.rb