Companion

Functions

Link copied to clipboard
fun getDaysInMonth(month: DateMonth, year: <Error class: unknown class>): <Error class: unknown class>

Returns the number of days in a month, taking leap years into account.

Link copied to clipboard
fun getMondayWeeksInYear(year: <Error class: unknown class>): <Error class: unknown class>

Returns the number of weeks in the year, where weeks are taken to start on Monday. Will be 52 or 53. The date must be valid. (Years always have 52 7-day periods, plus 1 or 2 extra days depending on whether it's a leap year. This function is basically telling you how many Mondays are in the year, i.e. there are 53 Mondays if one of the extra days happens to be a Monday.)

Link copied to clipboard
fun getSundayWeeksInYear(year: <Error class: unknown class>): <Error class: unknown class>

Returns the number of weeks in the year, where weeks are taken to start on Sunday. Will be 52 or 53. The date must be valid. (Years always have 52 7-day periods, plus 1 or 2 extra days depending on whether it's a leap year. This function is basically telling you how many Sundays are in the year, i.e. there are 53 Sundays if one of the extra days happens to be a Sunday.)

Link copied to clipboard
fun getType(): <Error class: unknown class>

Get the GType of Date

Link copied to clipboard
fun isLeapYear(year: <Error class: unknown class>): Boolean

Returns true if the year is a leap year.

Link copied to clipboard
fun validDay(day: <Error class: unknown class>): Boolean

Returns true if the day of the month is valid (a day is valid if it's between 1 and 31 inclusive).

Link copied to clipboard
fun validDmy(day: <Error class: unknown class>, month: DateMonth, year: <Error class: unknown class>): Boolean

Returns true if the day-month-year triplet forms a valid, existing day in the range of days #GDate understands (Year 1 or later, no more than a few thousand years in the future).

Link copied to clipboard
fun validJulian(julianDate: <Error class: unknown class>): Boolean

Returns true if the Julian day is valid. Anything greater than zero is basically a valid Julian, though there is a 32-bit limit.

Link copied to clipboard

Returns true if the month value is valid. The 12 #GDateMonth enumeration values are the only valid months.

Link copied to clipboard

Returns true if the weekday is valid. The seven #GDateWeekday enumeration values are the only valid weekdays.

Link copied to clipboard
fun validYear(year: <Error class: unknown class>): Boolean

Returns true if the year is valid. Any year greater than 0 is valid, though there is a 16-bit limit to what #GDate will understand.