class Holidays::DateCalculator::LunarDate

Graciously allowed by JeeWoong Yang (github.com/sunsidew)
Copied from github.com/sunsidew/ruby_lunardate

def lunardays_for_type(month_type)

def lunardays_for_type(month_type)
  LUNARDAYS_FOR_MONTHTYPE[month_type]
end

def to_s

def to_s
  format('%4d%02d%02d', year, month, day)
end

def to_solar(year, month, day, region)

def to_solar(year, month, day, region)
  days = 0
  year_diff = year - 1900
  year_info = CALENDAR_YEAR_INFO_MAP[region]
  year_diff.times do |year_idx|
    days += year_info[year_idx][0]
  end
  (month - 1).times do |month_idx|
    total, _normal, _leap = lunardays_for_type(year_info[year_diff][month_idx + 1])
    days += total
  end
  days += (day - 1)
  SOLAR_START_DATE + days
end