Method: Congo::Types::Date.parse_with_i18n
- Defined in:
- lib/congo/types.rb
.parse_with_i18n(str) ⇒ Object
Patch from gist.github.com/179712
49 50 51 52 53 |
# File 'lib/congo/types.rb', line 49 def self.parse_with_i18n(str) date = ::Date._strptime(str, I18n.t('congo.date.formats.default')) || self._parse(str) date[:year] += self.increment_year(date[:year].to_i) if date[:year] date end |