class Date

Constants

JAPAN

Public Class Methods

_parse(str, comp = true) click to toggle source
# File lib/wareki/std_ext.rb, line 36
def _parse(str, comp = true)
  di = Wareki::Date._parse(str)
  wdate = Wareki::Date.new(di[:era], di[:year], di[:month], di[:day], di[:is_leap])
rescue ArgumentError, Wareki::UnsupportedDateRange
  ::Date._wareki__parse_orig(str, comp)
else
  ::Date._wareki__parse_orig(str.sub(Wareki::REGEX, wdate.strftime('%F ')), comp)
end
Also aliased as: _wareki__parse_orig
_wareki__parse_orig(str, comp = true)
Alias for: _parse
_wareki_parse_orig(str = '-4712-01-01', comp = true, start = ::Date::ITALY)
Alias for: parse
parse(str = '-4712-01-01', comp = true, start = ::Date::ITALY) click to toggle source
# File lib/wareki/std_ext.rb, line 29
def parse(str = '-4712-01-01', comp = true, start = ::Date::ITALY)
  Wareki::Date.parse(str).to_date(start)
rescue ArgumentError, Wareki::UnsupportedDateRange
  ::Date._wareki_parse_orig(str, comp, start)
end
Also aliased as: _wareki_parse_orig

Public Instance Methods

_wareki_strftime_orig(format = '%F')
Alias for: strftime
strftime(format = '%F') click to toggle source
# File lib/wareki/std_ext.rb, line 19
def strftime(format = '%F')
  if format.index('%J')
    to_wareki_date.strftime(format)
  else
    _wareki_strftime_orig(format)
  end
end
Also aliased as: _wareki_strftime_orig
to_wareki_date() click to toggle source
# File lib/wareki/std_ext.rb, line 14
def to_wareki_date
  Wareki::Date.jd(jd)
end