# File lib/holidays.rb, line 239
  def self.orthodox_easter(year)
    y = year
    g = y % 19
    i = (19 * g + 15) % 30
    j = (year + year/4 + i) % 7
    j_month = 3 + (i - j + 40) / 44
    j_day = i - j + 28 - 31 * (j_month / 4)
    j_date = Date.civil(year, j_month, j_day)
    case
      # up until 1582, julian and gregorian easter dates were identical
      when year <= 1582
        offset = 0
      # between the years 1583 and 1699 10 days are added to the julian day count
      when (year >= 1583 and year <= 1699)
        offset = 10
      # after 1700, 1 day is added for each century, except if the century year is exactly divisible by 400 (in which case no days are added). 
      # Safe until 4100 AD, when one leap day will be removed.
      when year >= 1700 
        offset = (year - 1700).divmod(100)[0] + ((year - year.divmod(100)[1]).divmod(400)[1] == 0 ? 0 : 1) - (year - year.divmod(100)[1] - 1700).divmod(400)[0] + 10
    end
    # add offset to the julian day 
    return Date.jd(j_date.jd + offset)
  end