Determines the date of Midsummer Eve.
Friday between June 19-25
@param {number} year
@return {Date}
196546
function(year) {
    var self = this;
    var month = 6;
    var midsummerEve;

    self.range(19, 26).forEach(function(day) {
      if (!midsummerEve) {
        var date = self.createDate(year, month, day);
        var dayOfWeek = self.getDayOfWeek(date);

        if (dayOfWeek === self.FRIDAY) {
          midsummerEve = date;
        }
      }
    });

    return midsummerEve;
  }
587886
public static Date[] getHolidays(int year) {
		Set<Date> days = getHolidaySet(year);
		Date[] dates = days.toArray(new Date[days.size()]);
		Arrays.sort(dates);
		return dates;
	}
926633
private static int EquivalentYear(int year)
    {
        int day = (int) DayFromYear(year) + 4;
        day = day % 7;
        if (day < 0)
            day += 7;
        // Years and leap years on which Jan 1 is a Sunday, Monday, etc.
        if (IsLeapYear(year)) {
            switch (day) {
                case 0: return 1984;
                case 1: return 1996;
                case 2: return 1980;
                case 3: return 1992;
                case 4: return 1976;
                case 5: return 1988;
                case 6: return 1972;
            }
        } else {
            switch (day) {
                case 0: return 1978;
                case 1: return 1973;
                case 2: return 1985;
                case 3: return 1986;
                case 4: return 1981;
                case 5: return 1971;
                case 6: return 1977;
            }
        }
        // Unreachable
        throw Kit.codeBug();
    }
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);
  }
35152
function(jd) {
			jd = Math.floor(jd) + 0.5 - this.jdEpoch;
			var year = Math.floor(jd / 360);
			jd = jd % 360;
			jd += (jd < 0 ? 360 : 0);
			var month = Math.floor(jd / 20);
			var day = jd % 20;
			return this.newDate(year, month, day);
		}
720082
def daysInYear(date):
    
    # map from Qt information
    if type(date).__name__ in ('QDate', 'QDateTime', 'QTime'):
        date = date.toPython()

    if type(date) != int:
        year = date.year
    else:
        year = date

    if not year % 4:
        return 366
    return 365
1176971
public static int getYearFromData(Date date) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		return cal.get(Calendar.YEAR);
	}
258067
private function createOrthodoxSunday($year)
    {
        $a = $year % 4;
        $b = $year % 7;
        $c = $year % 19;
        $d = (19 * $c + 15) % 30;
        $e = (2 * $a + 4 * $b - $d + 34) % 7;
        $month = floor(($d + $e + 114) / 31);
        $day = (($d + $e + 114) % 31) + 1;

        $sunday = mktime(0, 0, 0, $month, $day + 13, $year);

        return new \DateTime(date('Y-m-d', $sunday));
    }
1085870
function dayOfYear() {
      var is_leap = (ICAL.Time.isLeapYear(this.year) ? 1 : 0);
      var diypm = ICAL.Time.daysInYearPassedMonth;
      return diypm[is_leap][this.month - 1] + this.day;
    }
552583
function datesOfToday () {
  const ret = {}

  ret.year = String(new Date().getFullYear())
  ret.month = prefix(String(new Date().getMonth()))
  ret.day = prefix(String(new Date().getDate()))
  ret.date = [ret.year, ret.month, ret.day].join('-')

  return ret
}
282849
function isLeap (date) {
  var year;
  if (typeof date === 'number') {
    year = date;
  } else {
    date = this.toDate(date);
    year = date.getFullYear();
  }
  return new Date(year, 1, 29).getDate() === 29;
}
1105977
function(d) {
    var year = later.Y.val(d);

    // shortcut on finding leap years since this function gets called a lot
    // works between 1901 and 2099
    return d.dyExtent || (d.dyExtent = [1, year % 4 ? 365 : 366]);
  }
1332688
function (year) {
			var daysCount = 0;
			for (var i = 1; i <= 12; i++) {
				daysCount += this.daysInMonth(year, i);
			}
			return daysCount;
		}
581630
function(year) {
			var months = Math.floor((235 * year - 234) / 19);
			var parts = 12084 + 13753 * months;
			var day = months * 29 + Math.floor(parts / 25920);
			if (mod(3 * (day + 1), 7) < 3) {
				day++;
			}
			return day;
		}
1334481
def today(year=None):
    """"""
    return datetime.date(int(year), _date.month, _date.day) if year else _date
11157
public static Integer getDayOfYear(Date date) {

        if (date == null)
            return null;

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);

        return calendar.get(Calendar.DAY_OF_YEAR);
    }
1153224
def get_good_friday(self, year):
        ""
        sunday = self.get_easter_sunday(year)
        return sunday - timedelta(days=2)