function epochDayToDate (epochDay) {
  epochDay = int(epochDay)

  let zeroDay = epochDay.add(DAYS_0000_TO_1970).subtract(60)
  let adjust = int(0)
  if (zeroDay.lessThan(0)) {
    const adjustCycles = zeroDay
      .add(1)
      .div(DAYS_PER_400_YEAR_CYCLE)
      .subtract(1)
    adjust = adjustCycles.multiply(400)
    zeroDay = zeroDay.add(adjustCycles.multiply(-DAYS_PER_400_YEAR_CYCLE))
  }
  let year = zeroDay
    .multiply(400)
    .add(591)
    .div(DAYS_PER_400_YEAR_CYCLE)
  let dayOfYearEst = zeroDay.subtract(
    year
      .multiply(365)
      .add(year.div(4))
      .subtract(year.div(100))
      .add(year.div(400))
  )
  if (dayOfYearEst.lessThan(0)) {
    year = year.subtract(1)
    dayOfYearEst = zeroDay.subtract(
      year
        .multiply(365)
        .add(year.div(4))
        .subtract(year.div(100))
        .add(year.div(400))
    )
  }
  year = year.add(adjust)
  const marchDayOfYear = dayOfYearEst

  const marchMonth = marchDayOfYear
    .multiply(5)
    .add(2)
    .div(153)
  const month = marchMonth
    .add(2)
    .modulo(12)
    .add(1)
  const day = marchDayOfYear
    .subtract(
      marchMonth
        .multiply(306)
        .add(5)
        .div(10)
    )
    .add(1)
  year = year.add(marchMonth.div(10))

  return new Date(year, month, day)
}
Converts given epoch day to a local date.
@param {Integer|number|string} epochDay the epoch day to convert.
@return {Date} the date representing the epoch day in years, months and days.