Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a Gregorian calendar date.

Hierarchy

Index

Constructors

constructor

Properties

Protected calendarEnd

calendarEnd: CalendarDate

End of a given date in a specific calendar.

calendarName

calendarName: "Gregorian" = JDNConvertibleCalendar.gregorian

Protected calendarStart

calendarStart: CalendarDate

Start of a given date in a specific calendar.

Protected exactDate

exactDate: Boolean

Indicates if the date is exact (start and end of the given period are equal).

Protected jdnEnd

jdnEnd: JDN

End of given date as JDN.

Protected jdnStart

jdnStart: JDN

Start of given date as JDN.

monthsInYear

monthsInYear: 12 = 12

yearZeroExists

yearZeroExists: true = true

Static Protected gregorian

gregorian: "Gregorian" = "Gregorian"

Constant for the Gregorian calendar.

Static Protected islamic

islamic: "Islamic" = "Islamic"

Constant for the Islamic calendar.

Static Protected julian

julian: "Julian" = "Julian"

Constant for the Julian calendar.

Static supportedCalendars

supportedCalendars: string[] = [JDNConvertibleCalendar.gregorian, JDNConvertibleCalendar.julian, JDNConvertibleCalendar.islamic]

Supported calendars (to be extended when new subclasses are implemented).

Methods

Protected JDNToCalendar

Protected calendarToJDN

convertCalendar

Protected convertJDNPeriodToCalendarPeriod

  • convertJDNPeriodToCalendarPeriod(jdnPeriod: JDNPeriod): void
  • Converts the given JDN period to a calendar period and stores it.

    This method makes sure that JDNs and calendar dates are in sync. This method has no return value, it manipulates this.calendarStart, and this.calendarEnd instead.

    Do not manipulate members this.exactDate, this.jdnStart, this.jdnEnd, this.calendarStart, and this.calendarEnd directly, use this method instead.

    Parameters

    • jdnPeriod: JDNPeriod

      the period defined by JDNs to be converted to a calendar period.

    Returns void

Protected dayOfWeekFromJDN

  • dayOfWeekFromJDN(jdn: number): number

daysInMonth

Protected handleMonthTransposition

toCalendarPeriod

toJDNPeriod

transposePeriodByDay

  • transposePeriodByDay(days: number): void

transposePeriodByMonth

  • transposePeriodByMonth(months: number): void
  • Transposes the current period by the given number of months.

    This method is not accurate in the arithmetical sense: it tries to fit the given day in the new month. If this is not possible, it takes the last day of the new month (e.g., January 31 will become the last possible day of February).

    Parameters

    • months: number

      the number of months that the current period will be shifted.

    Returns void

transposePeriodByYear

  • transposePeriodByYear(years: number): void
  • Transposes the current period by the given number of years.

    This method is not accurate in the arithmetical sense: it tries to fit the given day in the month of the new year. If this is not possible, it takes the last day of the new month (e.g., February 29 will become the last possible day of February).

    Parameters

    • years: number

      the number of years that the current period will be shifted.

    Returns void

Generated using TypeDoc