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