Class Index | File Index

Classes


Class GregorianDate


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

If the constructor is called with another Gregorian 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: ilib-full-dyn.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
GregorianDate(params)
Field Summary
Field Attributes Field Name and Description
 
day
The day of the month.
 
The hour of the day.
 
The millisecond of the second.
 
The minute of the hours.
 
The month number, ranging from 1 (January) to 12 (December).
 
The second of the minute.
 
Year in the Gregorian calendar.
Method Summary
Method Attributes Method Name and Description
 
Return the name of the calendar that governs 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.
Class Detail
GregorianDate(params)
Parameters:
{Object=} params
parameters that govern the settings and behaviour of this Gregorian date
Field Detail
{number} day
The day of the month. This ranges from 1 to 31.

{number} hour
The hour of the day. This can be a number from 0 to 23, as times are stored unambiguously in the 24-hour clock.

{number} millisecond
The millisecond of the second. Ranges from 0 to 999.

{number} minute
The minute of the hours. Ranges from 0 to 59.

{number} month
The month number, ranging from 1 (January) to 12 (December).

{number} second
The second of the minute. Ranges from 0 to 59.

{number} year
Year in the Gregorian calendar.
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} 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, January 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 Gregorian calendars is -1 for "before the common era" (BCE) and 1 for "the common era" (CE). BCE dates are any date before Jan 1, 1 CE. In the proleptic Gregorian calendar, there is a year 0, so any years that are negative or zero are BCE. In the Julian calendar, there is no year 0. Instead, the calendar goes straight from year -1 to 1.
Returns:
{number} 1 if this date is in the common era, -1 if it is before the common era

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 02 2016 15:53:55 GMT-0800 (PST)