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