Year

value class Year(val year: Int) : Comparable<Year> , Serializable

Represents a Year in a typed way.

A year is a set of 365 days or 366 for leap years. It is the time it takes the earth to fully orbit the sun.

The integrated model is capable of determine if a year is leap for years 1 until 9999 inclusive.

Constructors

Link copied to clipboard
constructor(year: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val days: Int

Total days of this year, 365 (non leap) DAYS_COMMON or 366 (leap) DAYS_LEAP.

Link copied to clipboard

Number of days since year 1 to reach this year

Link copied to clipboard

Determines if this year is leap. The model works for years between 1..9999. Outside this range, the result might be invalid.

Link copied to clipboard

Determines if this year is leap checking that the year is between 1..9999 or throwing a DateException when outside that range.

Link copied to clipboard

Number of leap years since the year 1 (without including this one)

Link copied to clipboard
val year: Int

Functions

Link copied to clipboard
open operator override fun compareTo(other: Year): Int

Compares two years.

Link copied to clipboard
fun Year.first(dayOfWeek: DayOfWeek): DateTime
Link copied to clipboard
operator fun minus(other: Year): Int
operator fun minus(delta: Int): Year
Link copied to clipboard
operator fun plus(delta: Int): Year
Link copied to clipboard

Creates a YearMonth representing this year and this month.