Class

PersianAlgoCal

PersianAlgoCal(optionsopt)

Construct a new Persian algorithmic calendar object. This class encodes information about a Persian algorithmic calendar.

Constructor

# new PersianAlgoCal(optionsopt)

Parameters:
Name Type Attributes Description
options Object <optional>

Options governing the construction of this instance

View Source PersianAlgoCal.js, line 32

Extends

Methods

# equivalentCycleYear(year) → {number}

Return the equivalent year in the 2820 year cycle that begins on Far 1, 474. This particular cycle obeys the cycle-of-years formula whereas the others do not specifically. This cycle can be used as a proxy for other years outside of the cycle by shifting them into the cycle.

Parameters:
Name Type Description
year number

year to find the equivalent cycle year for

View Source PersianAlgoCal.js, line 101

the equivalent cycle year

number

# getMonLength(month, year) → {number}

Return the number of days in a particular month in a particular year. This function can return a different number for a month depending on the year because of things like leap years.

Parameters:
Name Type Description
month number

the month for which the length is sought

year number

the year within which that month can be found

Overrides:

View Source PersianAlgoCal.js, line 83

the number of days within the given month in the given year

number

# getNumMonths(year) → {number}

Return the number of months in the given year. The number of months in a year varies for some luni-solar calendars because in some years, an extra month is needed to extend the days in a year to an entire solar year. The month is represented as a 1-based number where 1=first month, 2=second month, etc.

Parameters:
Name Type Description
year number

a year for which the number of months is sought

Overrides:

View Source PersianAlgoCal.js, line 70

The number of months in the given year

number

# getType() → {string}

Return the type of this calendar.

Overrides:

View Source PersianAlgoCal.js, line 121

the name of the type of this calendar

string

# isLeapYear(year) → {boolean}

Return true if the given year is a leap year in the Persian calendar. The year parameter may be given as a number, or as a PersAlgoDate object.

Parameters:
Name Type Description
year number

the year for which the leap year information is being sought

Overrides:

View Source PersianAlgoCal.js, line 112

true if the given year is a leap year

boolean