@param int $year
Default: year of this object.

@return bool
351327
public function isLeapYear(int $year = null) : bool
    {
        return !!date(
            'L',
            $year === null ? $this->getTimestamp() : mktime(1, 1, 1, 2, 1, $year)
        );
    }
50783
private YearInfo getYearInfo(int year) {
        YearInfo info = iYearInfoCache[year & CACHE_MASK];
        if (info == null || info.iYear != year) {
            info = new YearInfo(year, calculateFirstDayOfYearMillis(year));
            iYearInfoCache[year & CACHE_MASK] = info;
        }
        return info;
    }
1214768
public static function getDaysByMonthsOfYear($year = null): array
    {
        $year = $year ? $year : date('Y');
        $months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
        if (self::isLeapYear($year)) $months [1] = 29;
        return $months;
    }
610861
public static function is53WeekYear(int $year) : bool
    {
        $date = LocalDate::of($year, 1, 1);
        $dayOfWeek = $date->getDayOfWeek();

        return $dayOfWeek->is(DayOfWeek::THURSDAY)
            || ($dayOfWeek->is(DayOfWeek::WEDNESDAY) && $date->isLeapYear());
    }
676845
public static function isLeapYear($year)
    {
        if (preg_match('/\D/', $year)) {
            return false;
        }
        if ($year < 1000) {
            return false;
        }
        if ($year < 1582) {
            // pre Gregorio XIII - 1582
            return ($year % 4 == 0);
        } else {
            // post Gregorio XIII - 1582
            return (($year % 4 == 0) && ($year % 100 != 0)) || ($year % 400 == 0);
        }
    }
11000
public function year($value = null)
    {
        if ($value !== null) {
            if ($value < 0 || $value > 9999) {
                $this->year = 0;
            } else {
                $this->year = $value;
            }
        }
        return $this->year;
    }
1236585
def is_this_year(self):
        """"""
        return is_current_year(datetime.datetime.combine(self.date, datetime.time()))
578416
public function year($options = array())
    {
        $options = new AnConfig($options);
        $date = new AnDate(new AnConfig());
        $year = $date->year;

        $options->append(array(
            'start' => $year,
            'end' => $year + 10,
            'selected' => null,
            'prompt' => true,
        ));

        $selected = $options->selected;
        unset($options->selected);
        $prompt = $options->prompt;
        unset($options->prompt);
        $years = array_combine(range($options->start, $options->end), range($options->start, $options->end));

        if ($prompt) {
            $array = array(AnTranslator::_('LIB-AN-SELECTOR-SELECT-YEAR'));
            $years = AnHelperArray::merge($array, $years);
        }

        return $this->_html->select($options->name, array('options' => $years, 'selected' => $selected), AnConfig::unbox($options));
    }
633492
public static function check(int $year) : void
    {
        if ($year < self::MIN_VALUE || $year > self::MAX_VALUE) {
            throw DateTimeException::fieldNotInRange(self::NAME, $year, self::MIN_VALUE, self::MAX_VALUE);
        }
    }
1172063
protected function yearOrYearNo($year)
    {
        if (is_scalar($year)) {
            return $this->getYear($year);
        }

        if (!$year instanceof Year) {
            throw new InvalidArgumentException(
                '$year must be an instance of BmCalendar\Year; got "' . get_class($year) . '"'
            );
        }

        return $year;
    }
1159437
public function get(int $year)
    {
        // convert the Ethiopian year to a Julian year
        // ሚያዝያ 1 is just a random day after the Gregorian new year
        $julian_year = (int) DateTimeFactory::of($year, 8, 1)
            ->toGregorian()->format('Y');

        // get the number of days from vernal equinox to the Easter in the given Julian year
        $days_after = easter_days($julian_year, CAL_EASTER_ALWAYS_JULIAN);

        // get the JDN of vernal equinox (March 21) in the given Julian year
        $jdn = juliantojd(3, 21, $julian_year);

        // add the number of days to Easter
        $jdn += $days_after;

        // create a Ethiopian Date to JDN converter
        $con = new FromJdnConverter($jdn);

        // create an Ethiopian date from the converter
        return DateTimeFactory::of($con->getYear(), $con->getMonth(), $con->getDay(),
            0, 0, 0, $this->dateTimeZone);
    }
414231
function(year) {
			var date = this._validate(year, this.minMonth, this.minDay,
				$.calendars.local.invalidYear || $.calendars.regionalOptions[''].invalidYear);
			return (date.year() < 0 ? this.local.epochs[0] : this.local.epochs[1]);
		}
1299762
public static function schoolYearAtTime($year = null) {
		static::loadData();
		if (is_null($year)) return static::schoolYear();
		foreach(static::$arrDBCalendar as $sy) {
			//return graduation year of current school year if available
			if($sy['start'] < $year && $sy['end'] > $year) return date('Y',$sy['end']);
			//else - if a school year is found which begins later than now but already in the current calendar year, return the end year
			//-> summer holidays := following school year
			elseif($sy['start'] > $year && date('Y',$sy['start']) == date('Y')) return date('Y',$sy['end']);
		}
		return false;
	}
1129124
public static function cWeeks($year = null) {
		if ($year === null) {
			$year = date('Y');
		}
		return (int)date('W', mktime(23, 59, 59, 12, 28, $year));
	}
57454
public function getYear()
    {
        if ($this->year === null) {
            $match = [];
            preg_match(self::$REGEX_YEAR, $this->output, $match);
            $this->year = (int)(array_key_exists(2, $match) ? $match[2] : 0);
        }

        return $this->year;
    }
1275055
public final function setYear( int $year = null )
      : DateTime
   {

      if ( \is_null( $year ) )
      {
         $year = static::CurrentYear();
      }

      return $this->setDateParts( $year );

   }
969563
public function getYear($yearOrStart)
    {
        if (!$yearOrStart instanceof \DateTime) {
            $yearOrStart = new \DateTime(sprintf('%s-01-01', $yearOrStart));
        }

        return $this->getFactory()->createYear($yearOrStart);
    }