Year

inline class Year(value: Int) : Comparable<Year>

A year as defined by ISO-8601.

Parameters

value

the year

Throws

if the year is invalid

Constructors

Year
Link copied to clipboard
common
fun Year(value: Long)
Creates a Year.
Year
Link copied to clipboard
common
fun Year(value: Int)
Creates a Year.

Types

Companion
Link copied to clipboard
common
object Companion

Functions

compareTo
Link copied to clipboard
common
open operator override fun compareTo(other: Year): Int
contains
Link copied to clipboard
common
operator fun contains(date: Date): Boolean
operator fun contains(yearMonth: YearMonth): Boolean
equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
minus
Link copied to clipboard
common
operator fun minus(years: IntYears): Year
operator fun minus(years: LongYears): Year
plus
Link copied to clipboard
common
operator fun plus(years: IntYears): Year
operator fun plus(years: LongYears): Year
toString
Link copied to clipboard
common
open override fun toString(): String
Converts this year to a string in ISO-8601 extended format.

Properties

dateRange
Link copied to clipboard
common
val dateRange: DateRange
The date range of the year.
dayRange
Link copied to clipboard
common
val dayRange: IntRange
The day range of the year.
endDate
Link copied to clipboard
common
val endDate: Date
The last date of the year.
isLeap
Link copied to clipboard
common
val isLeap: Boolean
Checks if this is a leap year.
lastDay
Link copied to clipboard
common
val lastDay: Int
The last day of the year.
length
Link copied to clipboard
common
val length: IntDays
The length of the year in days.
startDate
Link copied to clipboard
common
val startDate: Date
The first date of the year.
value
Link copied to clipboard
common
val value: Int
The year value.

Extensions

at
Link copied to clipboard
common
infix fun Year.at(month: Month): YearMonth
Combines a year and month to create a YearMonth.
atMonth
Link copied to clipboard
common
fun Year.atMonth(number: Int): YearMonth
Combines a year and month number to create a YearMonth.
toJavaYear
Link copied to clipboard
fun Year.toJavaYear(): Year
Converts this year to an equivalent Java Year.
toNSDateComponents
Link copied to clipboard
darwin
fun Year.toNSDateComponents(includeCalendar: Boolean = false): <ERROR CLASS>
Converts this year to an equivalent NSDateComponents object.