Module: FeCoreExt::CoreExt::DateClassMethods
- Included in:
- Date
- Defined in:
- lib/fe_core_ext/core_ext/date.rb
Instance Method Summary collapse
Instance Method Details
#parse_as_future(string) ⇒ Object
22 23 24 25 |
# File 'lib/fe_core_ext/core_ext/date.rb', line 22 def parse_as_future(string) date = parse(string) date > current ? date : date + 1.year end |
#parse_heisei(string) ⇒ Object
27 28 29 30 31 |
# File 'lib/fe_core_ext/core_ext/date.rb', line 27 def parse_heisei(string) string.match('平成(\d+)年(\d+)月(\d+)日') { Date.new($1.to_i + 1988, $2.to_i, $3.to_i) } end |