Class: FuzzyDate::FDate

Inherits:
Date
  • Object
show all
Defined in:
lib/fuzzy_date.rb

Overview

overload the Date class to modify its parsing routine a little

Class Method Summary collapse

Class Method Details

._parse_year(str, e) ⇒ Object

:nodoc:



46
47
48
49
50
51
52
53
# File 'lib/fuzzy_date.rb', line 46

def self._parse_year(str, e) 
  if str.sub!(/(\d{3,})\b/in, ' ')
    e.year = $1.to_i
    true
  else
    super(str,e)
  end
end