Class Index | File Index

Classes


Class HanDate


Extends Date.
Construct a new Han date object. The constructor parameters can contain any of the following properties:

If the constructor is called with another Han date instance instead of a parameter block, the other instance acts as a parameter block and its settings are copied into the current instance.

If the constructor is called with no arguments at all or if none of the properties listed above from unixtime through millisecond are present, then the date components are filled in with the current date at the time of instantiation. Note that if you do not give the time zone when defaulting to the current time and the time zone for all of ilib was not set with ilib.setTimeZone(), then the time zone will default to UTC ("Universal Time, Coordinated" or "Greenwich Mean Time").

If any of the properties from year through millisecond are not specified in the params, it is assumed that they have the smallest possible value in the range for the property (zero or one).


Defined in: HanDate.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
HanDate(params)
Method Summary
Method Attributes Method Name and Description
 
Return the name of the calendar that governs this date.
 
Return the Chinese cycle number of this date.
 
Return the year within the Chinese cycle of this date.
 
Return the day of the week of this date.
 
Return the ordinal day of the year.
 
Return the era for this date as a number.
 
Return whether the month of this date is a leap month in the Chinese Han calendar.
 
Return whether the year of this date is a leap year in the Chinese Han calendar.
 
newRd(params)
Return a new RD for this date type using the given params.
Class Detail
HanDate(params)
Parameters:
{Object=} params
parameters that govern the settings and behaviour of this Han date
Method Detail
{string} getCalendar()
Return the name of the calendar that governs this date.
Returns:
{string} a string giving the name of the calendar

{number} getCycles()
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.
Returns:
{number} the current Chinese cycle

{number} getCycleYears()
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.
Returns:
{number} the year within the current Chinese cycle

{number} getDayOfWeek()
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.
Returns:
{number} the day of the week

{number} getDayOfYear()
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.
Returns:
{number} the ordinal day of the year

{number} getEra()
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.
Returns:
{number} 1 if this date is in the common era, -1 if it is before the common era

{boolean} isLeapMonth()
Return whether the month of this date is a leap month in the Chinese Han calendar.
Returns:
{boolean} true if the month of this date is a leap month in the Chinese Han calendar.

{boolean} isLeapYear()
Return whether the year of this date is a leap year in the Chinese Han calendar.
Returns:
{boolean} true if the year of this date is a leap year in the Chinese Han calendar.

{RataDie} newRd(params)
Return a new RD for this date type using the given params.
Parameters:
{Object=} params
the parameters used to create this rata die instance
Returns:
{RataDie} the new RD instance for the given params

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Nov 15 2018 17:45:08 GMT-0800 (PST)