returns the number of year in current grand cycle

@param int $year the year in jalali calendar

@return number
423976
private static function calculateYearInGrandCycle($year) {
        
        $grandCycle = static::calculateGrandCycle($year);
        
        if ($grandCycle < 0) {
            
            $year = (static::GRAND_CYCLE_BEGINNING + ($grandCycle * static::GRAND_CYCLE_LENGTH)) - $year;
            
        } elseif ($grandCycle > 0) {
            
            $year = $year - (static::GRAND_CYCLE_BEGINNING + ($grandCycle * static::GRAND_CYCLE_LENGTH));
            
        } else {
            
            $year -= static::GRAND_CYCLE_BEGINNING;
        }
        
        $yearInGrandCycle = abs($year) + 1;
        
        return $yearInGrandCycle;
    }
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;
	}
1348393
public int getShowYear() {
        Calendar cal = Calendar.getInstance();
        cal.setTime(getDate());
        return cal.get(Calendar.YEAR);
    }
64086
public function getAge(int $jd): int
    {
        if ($this->year === 0 || $jd === 0) {
            return 0;
        }
        if ($this->minimum_julian_day < $jd && $this->maximum_julian_day > $jd) {
            return 0;
        }
        if ($this->minimum_julian_day === $jd) {
            return 0;
        }
        [$y, $m, $d] = $this->calendar->jdToYmd($jd);
        $dy = $y - $this->year;
        $dm = $m - max($this->month, 1);
        $dd = $d - max($this->day, 1);
        if ($dd < 0) {
            $dm--;
        }
        if ($dm < 0) {
            $dy--;
        }

        // Not a full age? Then just the years
        return $dy;
    }
903137
function(year) {
			var date = this._validate(year, this.minMonth, this.minDay, $.calendars.local.invalidYear);
			year = date.year();
			if (typeof this.NEPALI_CALENDAR_DATA[year] === 'undefined') {
				return this.daysPerYear;
			}
			var daysPerYear = 0;
			for (var month_number = this.minMonth; month_number <= 12; month_number++) {
				daysPerYear += this.NEPALI_CALENDAR_DATA[year][month_number];
			}
			return daysPerYear;
		}
1347182
public function getMonths($year)
    {
        $year = $this->yearOrYearNo($year);

        $months = array();

        for ($monthNo = 1; $monthNo <= 12; $monthNo++) {
            $months[$monthNo] = new Month($year, $monthNo);
        }

        return $months;
    }
957405
private static int getYearInCycle(int cycleNumber, long dayOfCycle) {
        Integer[] cycles = getAdjustedCycle(cycleNumber);
        if (dayOfCycle == 0) {
            return 0;
        }

        if (dayOfCycle > 0) {
            for (int i = 0; i < cycles.length; i++) {
                if (dayOfCycle < cycles[i].intValue()) {
                    return i - 1;
                }
            }
            return 29;
        } else {
            dayOfCycle = -dayOfCycle;
            for (int i = 0; i < cycles.length; i++) {
                if (dayOfCycle <= cycles[i].intValue()) {
                    return i - 1;
                }
            }
            return 29;
        }
    }
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;
    }
378603
public static function firstSundayOfYear($year = null)
    {
        $year = $year ? (int) $year : Date('Y');
        $sunday = Carbon::parse($year . '-01-01')->startOfWeek(Carbon::SUNDAY);
        return ((int) $sunday->format('Y') === $year) ? $sunday : $sunday->addDays(7);
    }
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);
        }
    }
576192
public function getByTerm($year, $term)
    {
        $url = $this->requestUrl;

        $param['__VIEWSTATE'] = true;
        $param['__EVENTTARGET'] = "xnd";
        $param['__EVENTARGUMENT'] = "";
        $param['xnd'] = $year;
        $param['xqd'] = $term;

        $response = $this->request('post', [$url, $param]);

        return $this->parseSchedule($response);
    }
498201
public function getNumberOfDays(Year $year): int
    {
        return $this->getValue() === self::FEBRUARY
            ? ($year->isLeapYear() ? 29 : 28)
            : ($this->getValue() % 2 === 0 ? 30 : 31);
    }
808215
public function getRelativeYearCount($end = null, $locale = null, $query = null, $cacheKey = null)
    {
        if (is_null($end))
        {
            $end = Carbon::today();
        }

        return $this->getCountInBetween($end->copy()->subYear()->startOfDay(), $end->endOfDay(), $locale, $query, $cacheKey);
    }
459135
public static function easterDate($year)
    {
        if ($year < 1970 || $year > 2037) {
            return trigger_error('This function is only valid for years between 1970 and 2037 inclusive', E_USER_WARNING);
        }

        $days = self::$gregorian_calendar->easterDays($year);

        // Calculate time-zone offset
        $date_time      = new \DateTime('now', new \DateTimeZone(date_default_timezone_get()));
        $offset_seconds = (int) $date_time->format('Z');

        if ($days < 11) {
            return self::jdtounix(self::$gregorian_calendar->ymdToJd($year, 3, $days + 21)) - $offset_seconds;
        } else {
            return self::jdtounix(self::$gregorian_calendar->ymdToJd($year, 4, $days - 10)) - $offset_seconds;
        }
    }
1053599
public function plusYears(int $years) : YearMonth
    {
        if ($years === 0) {
            return $this;
        }

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

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

      return $this->setDateParts( $year );

   }
731997
public static function of(int $year) : Year
    {
        Field\Year::check($year);

        return new Year($year);
    }