About Spectre Calendars

Spectre includes many features for creating and using custom calendars and functions for working with calendars, dates, and periods.

Spectre has two data types related to dates: Date and Period. The date type always represents a day in the widely used Gregorian Calendar, also known as the "standard" calendar. While the date type can be formatted differently (for example, "2017-02-02" or "Thu, Feb 2, 2017"), the date type cannot be used to represent days in alternative calendars.

The period type, on the other hand, represents a range of days and can be customized to use different calendars and periods. For example, a period value can represent the month of February 2017, the third quarter in fiscal year 2010, or the entire ISO week year of 2016. A period needs to be associated with a calendar to map to real dates.

Spectre can handle a variety of periods, based on the calendars provided. Spectre supports the standard calendar with 12 months and 4 quarters. It supports an offset calendar so you can define a fiscal calendar by specifying, for example, that the year starts on July 1 rather than January 1—you still have 12 months and 4 quarters. Spectre allows you to specify custom calendars that can support other notions of week, month, quarter, tertile, and half delineations. A custom calendar can be defined and used to support for example, 4-4-5 type fiscal calendars. Spectre also supports use of the ISO 8601 calendar.