# new HanDate(paramsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object
|
<optional> |
parameters that govern the settings and behaviour of this Han date |
Extends
- Date
Members
Methods
# getCalendar() → {string}
Return the name of the calendar that governs this date.
a string giving the name of the calendar
string
# getCycleYears() → {number}
Return the year within the Chinese cycle of this date. Cycles are 60 years long, and the value returned from this method is the number of the year within this cycle. The year returned from getYear() is the total elapsed years since the beginning of the Chinese epoch and does not include the cycles.
the year within the current Chinese cycle
number
# getCycles() → {number}
Return the Chinese cycle number of this date. Cycles are 60 years long, and the value returned from getCycleYear() is the number of the year within this cycle. The year returned from getYear() is the total elapsed years since the beginning of the Chinese epoch and does not include the cycles.
the current Chinese cycle
number
# getDayOfWeek() → {number}
Return the day of the week of this date. The day of the week is encoded as number from 0 to 6, with 0=Sunday, 1=Monday, etc., until 6=Saturday.
the day of the week
number
# getDayOfYear() → {number}
Return the ordinal day of the year. Days are counted from 1 and proceed linearly up to 365, regardless of months or weeks, etc. That is, Farvardin 1st is day 1, and December 31st is 365 in regular years, or 366 in leap years.
the ordinal day of the year
number
# getEra() → {number}
Return the era for this date as a number. The value for the era for Han calendars is -1 for "before the han era" (BP) and 1 for "the han era" (anno persico or AP). BP dates are any date before Farvardin 1, 1 AP. In the proleptic Han calendar, there is a year 0, so any years that are negative or zero are BP.
1 if this date is in the common era, -1 if it is before the common era
number
# isLeapMonth() → {boolean}
Return whether the month of this date is a leap month in the Chinese Han calendar.
true if the month of this date is a leap month in the Chinese Han calendar.
boolean
# isLeapYear() → {boolean}
Return whether the year of this date is a leap year in the Chinese Han calendar.
true if the year of this date is a leap year in the Chinese Han calendar.
boolean