Gregorian

$(ANCHOR _Gregorian) Represents the Gregorian calendar.

Note that this is the Proleptic Gregorian calendar. Most calendars assume that dates before 9/14/1752 were Julian Dates. Julian differs from Gregorian in that leap years occur every 4 years, even on 100 year increments. The Proleptic Gregorian calendar applies the Gregorian leap year rules to dates before 9/14/1752, making the calculation of dates much easier.

Constructors

this
this(Type type)

Initializes an instance of the Gregorian class using the specified GregorianTypes value. If no value is specified, the default is Gregorian.Types.Localized.

Members

Aliases

toTime
alias toTime = Calendar.toTime
Undocumented in source.

Enums

AD_ERA
anonymousenum AD_ERA

Represents the current era.

Type
enum Type
Undocumented in source.

Functions

addMonths
Time addMonths(Time t, int nMonths, bool truncateDay)

Overridden. Returns a new Time with the specified number of months added. If the months are negative, the months are subtracted.

addYears
Time addYears(Time t, int nYears)

Overridden. Add the specified number of years to the given Time.

calendarType
Type calendarType()

Property. Retrieves the GregorianTypes value indicating the language version of the Gregorian.

eras
uint[] eras()

Property. Overridden. Retrieves the list of eras in the current calendar.

getDayOfMonth
uint getDayOfMonth(Time time)

Overridden. Returns the day of the month in the specified Time.

getDayOfWeek
DayOfWeek getDayOfWeek(Time time)

Overridden. Returns the day of the week in the specified Time.

getDayOfYear
uint getDayOfYear(Time time)

Overridden. Returns the day of the year in the specified Time.

getDaysInMonth
uint getDaysInMonth(uint year, uint month, uint era)

Overridden. Returns the number of days in the specified _year and _month of the specified _era.

getDaysInYear
uint getDaysInYear(uint year, uint era)

Overridden. Returns the number of days in the specified _year of the specified _era.

getEra
uint getEra(Time time)

Overridden. Returns the era in the specified Time.

getMonth
uint getMonth(Time time)

Overridden. Returns the month in the specified Time.

getMonthsInYear
uint getMonthsInYear(uint year, uint era)

Overridden. Returns the number of months in the specified _year of the specified _era.

getYear
uint getYear(Time time)

Overridden. Returns the year in the specified Time.

id
uint id()

Property. Overridden. Retrieves the identifier associated with the current calendar.

isLeapYear
bool isLeapYear(uint year, uint era)

Overridden. Indicates whether the specified _year in the specified _era is a leap _year.

split
void split(Time time, uint year, uint month, uint day, uint doy, uint dow, uint era)

Overridden. Get the components of a Time structure using the rules of the calendar. This is useful if you want more than one of the given components. Note that this doesn't handle the time of day, as that is calculated directly from the Time struct.

toTime
Time toTime(uint year, uint month, uint day, uint hour, uint minute, uint second, uint millisecond, uint era)

Overridden. Returns a Time value set to the specified date and time in the specified _era.

Static functions

argumentError
void argumentError(istring str)
Undocumented in source. Be warned that the author may not have intended to support it.
extractPart
uint extractPart(long ticks, DatePart part)
Undocumented in source. Be warned that the author may not have intended to support it.
getDateTicks
long getDateTicks(uint year, uint month, uint day, uint era)
Undocumented in source. Be warned that the author may not have intended to support it.
splitDate
void splitDate(long ticks, uint year, uint month, uint day, uint dayOfYear, uint era)
Undocumented in source. Be warned that the author may not have intended to support it.
staticIsLeapYear
bool staticIsLeapYear(uint year, uint era)
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

generic
Gregorian generic;

static shared instance

Inherited Members

From Calendar

CURRENT_ERA
anonymousenum CURRENT_ERA

Indicates the current era of the calendar.

GREGORIAN
anonymousenum GREGORIAN
Undocumented in source.
WeekRule
enum WeekRule
Undocumented in source.
DatePart
enum DatePart
Undocumented in source.
DayOfWeek
enum DayOfWeek
Undocumented in source.
toDate
Date toDate(Time time)

Get the components of a Time structure using the rules of the calendar. This is useful if you want more than one of the given components. Note that this doesn't handle the time of day, as that is calculated directly from the Time struct.

split
void split(Time time, uint year, uint month, uint day, uint doy, uint dow, uint era)

Get the components of a Time structure using the rules of the calendar. This is useful if you want more than one of the given components. Note that this doesn't handle the time of day, as that is calculated directly from the Time struct.

toTime
Time toTime(uint year, uint month, uint day, uint hour, uint minute, uint second, uint millisecond)

Returns a Time value set to the specified date and time in the current era.

toTime
Time toTime(Date d)

Returns a Time value for the given Date, in the current era

toTime
Time toTime(DateTime dt)

Returns a Time value for the given DateTime, in the current era

toTime
Time toTime(Date d, TimeOfDay t)

Returns a Time value for the given Date and TimeOfDay, in the current era

toTime
Time toTime(uint year, uint month, uint day, uint hour, uint minute, uint second, uint millisecond, uint era)

When overridden, returns a Time value set to the specified date and time in the specified _era.

getDayOfWeek
DayOfWeek getDayOfWeek(Time time)

When overridden, returns the day of the week in the specified Time.

getDayOfMonth
uint getDayOfMonth(Time time)

When overridden, returns the day of the month in the specified Time.

getDayOfYear
uint getDayOfYear(Time time)

When overridden, returns the day of the year in the specified Time.

getMonth
uint getMonth(Time time)

When overridden, returns the month in the specified Time.

getYear
uint getYear(Time time)

When overridden, returns the year in the specified Time.

getEra
uint getEra(Time time)

When overridden, returns the era in the specified Time.

getDaysInMonth
uint getDaysInMonth(uint year, uint month)

Returns the number of days in the specified _year and _month of the current era.

getDaysInMonth
uint getDaysInMonth(uint year, uint month, uint era)

When overridden, returns the number of days in the specified _year and _month of the specified _era.

getDaysInYear
uint getDaysInYear(uint year)

Returns the number of days in the specified _year of the current era.

getDaysInYear
uint getDaysInYear(uint year, uint era)

When overridden, returns the number of days in the specified _year of the specified _era.

getMonthsInYear
uint getMonthsInYear(uint year)

Returns the number of months in the specified _year of the current era.

getMonthsInYear
uint getMonthsInYear(uint year, uint era)

When overridden, returns the number of months in the specified _year of the specified _era.

getWeekOfYear
uint getWeekOfYear(Time time, WeekRule rule, DayOfWeek firstDayOfWeek)

Returns the week of the year that includes the specified Time.

isLeapYear
bool isLeapYear(uint year)

Indicates whether the specified _year in the current era is a leap _year.

isLeapYear
bool isLeapYear(uint year, uint era)

When overridden, indicates whether the specified _year in the specified _era is a leap _year.

eras
uint[] eras()

Property. When overridden, retrieves the list of eras in the current calendar.

id
uint id()

Property. Retrieves the identifier associated with the current calendar.

addMonths
Time addMonths(Time t, int nMonths, bool truncateDay)

Returns a new Time with the specified number of months added. If the months are negative, the months are subtracted.

addYears
Time addYears(Time t, int nYears)

Add the specified number of years to the given Time.

getTimeTicks
long getTimeTicks(uint hour, uint minute, uint second)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta