Determines the date of All Saints' Day.
Saturday between October 31 and November 6
@param {number} year
@return {Date}
764860
function(year) {
    var self = this;
    var october31 = self.createDate(year, 10, 31);
    var secondMonth = 11;
    var allSaintsDay;

    if (self.getDayOfWeek(october31) === self.SATURDAY) {
      allSaintsDay = october31;
    } else {
      self.range(1, 6).forEach(function(day) {
        if (!allSaintsDay) {
          var date = self.createDate(year, secondMonth, day);
          var dayOfWeek = self.getDayOfWeek(date);

          if (dayOfWeek === self.SATURDAY) {
            allSaintsDay = date;
          }
        }
      });
    }

    return allSaintsDay;
  }
309866
def date(self, year: Number, month: Number, day: Number) -> Date:
        
        return Date(year, month, day)
289769
def day_of_year(self):
        
        k = 1 if self.is_leap_year() else 2

        return (275 * self.month) // 9 - k * ((self.month + 9) // 12) + self.day - 30
1248022
function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) {
        var d = new Date(Date.UTC(year, 0)).getUTCDay(),
            daysToAdd, dayOfYear;

        weekday = weekday != null ? weekday : firstDayOfWeek;
        daysToAdd = firstDayOfWeek - d + (d > firstDayOfWeekOfYear ? 7 : 0);
        dayOfYear = 7 * (week - 1) + (weekday - firstDayOfWeek) + daysToAdd + 1;

        return {
            year: dayOfYear > 0 ? year : year - 1,
            dayOfYear: dayOfYear > 0 ?  dayOfYear : daysInYear(year - 1) + dayOfYear
        };
    }
970180
def easter(year=None):
    
    y = int(year) if year else _year
    n = y - 1900
    a = n % 19
    q = n // 4
    b = (7 * a + 1) // 19
    m = (11 * a + 4 - b) % 29
    w = (n + q + 31 - m) % 7
    d = 25 - m - w
    if d > 0:
        return datetime.date(y, 4, d)
    else:
        return datetime.date(y, 3, (31 + d))
884198
function(year) {
			this._validate(year, this.minMonth, this.minDay, $.calendars.local.invalidYear);
			return this._leapYear(year.year ? year.year() : year) ? 13 : 12;
		}
659515
function startOfYear() {
      var result = this.clone();
      result.day = 1;
      result.month = 1;
      result.isDate = true;
      result.hour = 0;
      result.minute = 0;
      result.second = 0;
      return result;
    }
460244
def day_of_year(date = self)
      date.month == 1 ? date.day : (DAYS_IN_YEAR[date.month - 2] + date.day)
    end
289442
private function getReformationDay($year, $additionalType = HolidayType::OTHER, DateTimeZone $timezone = null)
    {
        return new Holiday(HolidayName::REFORMATION_DAY, new DateTime(sprintf('%s-10-31', $year), $timezone), HolidayType::RELIGIOUS | $additionalType);
    }
1208789
private function getAllSaintsDay($year, $additionalType = HolidayType::OTHER, DateTimeZone $timezone = null)
    {
        return new Holiday(HolidayName::ALL_SAINTS_DAY, new DateTime(sprintf('%s-11-01', $year), $timezone), HolidayType::RELIGIOUS | $additionalType);
    }
900618
public function easterDays($year)
    {
        // The “golden” number
        $golden = 1 + $year % 19;

        // The “dominical” number (finding a Sunday)
        $dom = ($year + (int) ($year / 4) + 5) % 7;
        if ($dom < 0) {
            $dom += 7;
        }

        // The uncorrected “Paschal full moon” date
        $pfm = (3 - 11 * $golden - 7) % 30;
        if ($pfm < 0) {
            $pfm += 30;
        }

        // The corrected “Paschal full moon” date
        if ($pfm === 29 || $pfm === 28 && $golden > 11) {
            $pfm--;
        }

        $tmp = (4 - $pfm - $dom) % 7;
        if ($tmp < 0) {
            $tmp += 7;
        }

        return $pfm + $tmp + 1;
    }
823210
function(date) {
        if (this._calendar.name !== date._calendar.name) {
            throw (_exports.local.differentCalendars || _exports.regionalOptions[''].differentCalendars).
                replace(/\{0\}/, this._calendar.local.name).replace(/\{1\}/, date._calendar.local.name);
        }
        var c = (this._year !== date._year ? this._year - date._year :
            this._month !== date._month ? this.monthOfYear() - date.monthOfYear() :
            this._day - date._day);
        return (c === 0 ? 0 : (c < 0 ? -1 : +1));
    }
834258
private function getSecondChristmasDay($year, $additionalType = HolidayType::OTHER, DateTimeZone $timezone = null)
    {
        return new Holiday(HolidayName::SECOND_CHRISTMAS_DAY, new DateTime(sprintf('%s-12-26', $year), $timezone), HolidayType::RELIGIOUS | $additionalType);
    }
813401
public function easterDays($year)
    {
        // The “golden” number
        $golden = $year % 19 + 1;

        // The “dominical” number (finding a Sunday)
        $dom = ($year + (int) ($year / 4) - (int) ($year / 100) + (int) ($year / 400)) % 7;
        if ($dom < 0) {
            $dom += 7;
        }

        // The solar correction
        $solar = (int) (($year - 1600) / 100) - (int) (($year - 1600) / 400);

        // The lunar correction
        $lunar = (int) ((int) (($year - 1400) / 100) * 8) / 25;

        // The uncorrected “Paschal full moon” date
        $pfm = (3 - 11 * $golden + $solar - $lunar) % 30;
        if ($pfm < 0) {
            $pfm += 30;
        }

        // The corrected “Paschal full moon” date
        if ($pfm === 29 || $pfm === 28 && $golden > 11) {
            $pfm--;
        }

        $tmp = (4 - $pfm - $dom) % 7;
        if ($tmp < 0) {
            $tmp += 7;
        }

        return $pfm + $tmp + 1;
    }
1039745
function(year, month, day) {
    var dayOfWeek = this.createDate(year, month, day).getDay();
    return dayOfWeek === this.SATURDAY || dayOfWeek === this.SUNDAY;
  }
1220341
public String getEasterSunday(int year, int days) {
		int K = year / 100;
		int M = 15 + ( ( 3 * K + 3 ) / 4 ) - ( ( 8 * K + 13 ) / 25 );
		int S = 2 - ( (3 * K + 3) / 4 );
		int A = year % 19;
		int D = ( 19 * A + M ) % 30;
		int R = ( D / 29) + ( ( D / 28 ) - ( D / 29 ) * ( A / 11 ) );
		int OG = 21 + D - R;
		int SZ = 7 - ( year + ( year / 4 ) + S ) % 7;
		int OE = 7 - ( OG - SZ ) % 7;
		int OS = OG + OE;
		
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
		Calendar c = Calendar.getInstance();
		String date;
		
		if( OS <= 31 ) {
			date = String.format("%04d-03-%02d", year, OS);
		}
		else{
			date = String.format("%04d-04-%02d", year, ( OS - 31 ) );
		}		
		try{
			c.setTime(formatter.parse(date));
			c.add(Calendar.DAY_OF_MONTH, days);
			date = formatter.format(c.getTime());
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return date;
	}
1261358
function(year) {
    var date = this.easterSunday(year);
    var y = date.getFullYear();
    var m = date.getMonth() + 1;
    var d = date.getDate() + 1;
    return this.createDate(y, m, d);
  }