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
14 15 16 17 |
# File 'lib/fe_core_ext/core_ext/date.rb', line 14 def parse_as_future(string) date = parse(string) date > current ? date : date + 1.year end |
#parse_heisei(string) ⇒ Object
19 20 21 22 23 |
# File 'lib/fe_core_ext/core_ext/date.rb', line 19 def parse_heisei(string) string.match('平成(\d+)年(\d+)月(\d+)日') { Date.new($1.to_i + 1988, $2.to_i, $3.to_i) } end |