Class IslamicDate
Extends
IDate.
Construct a new civil Islamic date object. The constructor can be called
with a params object that can contain the following properties:
- julianday - the Julian Day to set into this date
- year - any integer except 0. Years go from -1 (BCE) to 1 (CE), skipping the zero year
- month - 1 to 12, where 1 means Muharram, 2 means Saffar, etc.
- day - 1 to 30
- hour - 0 to 23. A formatter is used to display 12 hour clocks, but this representation is always done with an unambiguous 24 hour representation
- minute - 0 to 59
- second - 0 to 59
- millisecond - 0 to 999
- locale - the TimeZone instance or time zone name as a string of this julian date. The date/time is kept in the local time. The time zone is used later if this date is formatted according to a different time zone and the difference has to be calculated, or when the date format has a time zone component in it.
- timezone - the time zone of this instance. If the time zone is not given, it can be inferred from this locale. For locales that span multiple time zones, the one with the largest population is chosen as the one that represents the locale.
- date - use the given intrinsic Javascript date to initialize this one.
If the constructor is called with no arguments at all or if none of the properties listed above from julianday 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").
Defined in: ilib-full-dyn.js.
Constructor Attributes | Constructor Name and Description |
---|---|
IslamicDate(params)
|
Field Attributes | Field Name and Description |
---|---|
The day of the month.
|
|
The day of the year.
|
|
The hour of the day.
|
|
The millisecond of the second.
|
|
The minute of the hours.
|
|
The month number, ranging from 1 to 12 (December).
|
|
The second of the minute.
|
|
Year in the Islamic calendar.
|
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.
|
|
getEra()
Return the era for this date as a number.
|
|
newRd(params)
Return a new RD for this date type using the given params.
|
Class Detail
IslamicDate(params)
- Parameters:
- {Object=} params
- parameters that govern the settings and behaviour of this Islamic date
Field Detail
{number}
day
The day of the month. This ranges from 1 to 30.
{number}
dayOfYear
The day of the year. Ranges from 1 to 355.
{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 to 12 (December).
{number}
second
The second of the minute. Ranges from 0 to 59.
{number}
year
Year in the Islamic 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
354 or 355, regardless of months or weeks, etc. That is, Muharran 1st is day 1, and
Dhu al-Hijja 29 is 354.
- 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 Islamic
calendars is -1 for "before the Islamic era" and 1 for "the Islamic era".
Islamic era dates are any date after Muharran 1, 1, which is the same as
July 16, 622 CE in the Gregorian calendar.
- Returns:
- {number} 1 if this date is in the common era, -1 if it is before the common era
{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