LocalIsoWeekDate

constructor(isoWeekYear: Int, isoWeekNumber: Int, dayOfWeek: DayOfWeek)(source)

Constructs a LocalIsoWeekDate instance from the given date components.

The isoWeekNumber component is 1-based.

The supported ranges of components:

Additionally, the full range of supported dates is exactly the same as that of LocalDate.

See also

for a version that returns null instead of throwing an exception when the parameters are invalid.

Throws

if any parameter is out of range or if isoWeekNumber is invalid for the given isoWeekYear.

Samples

import kotlinx.datetime.*
import kotlin.test.*

fun main() { 
   //sampleStart 
   // Constructing a LocalIsoWeekDate corresponding to the date 2005-01-01
val isoWeekDate = LocalIsoWeekDate(2004, 53, DayOfWeek.SATURDAY)
check(2004 == isoWeekDate.isoWeekYear) // note: not 2005!
check(53 == isoWeekDate.isoWeekNumber)
check(DayOfWeek.SATURDAY == isoWeekDate.dayOfWeek) 
   //sampleEnd
}

constructor(isoWeekYear: Int, isoWeekNumber: Int, dayOfWeek: Int)(source)

Constructs a LocalIsoWeekDate instance from the given date components.

The components isoWeekNumber and dayOfWeek are 1-based.

The supported ranges of components:

Additionally, the full range of supported dates is exactly the same as that of LocalDate.

See also

for a version that returns null instead of throwing an exception when the parameters are invalid.

Throws

if any parameter is out of range or if isoWeekNumber is invalid for the given isoWeekYear.

Samples

import kotlinx.datetime.*
import kotlin.test.*

fun main() { 
   //sampleStart 
   // Constructing a LocalIsoWeekDate corresponding to the date 2005-01-01
val isoWeekDate = LocalIsoWeekDate(2004, 53, 6)
check(2004 == isoWeekDate.isoWeekYear) // note: not 2005!
check(53 == isoWeekDate.isoWeekNumber)
check(6 == isoWeekDate.dayOfWeek.isoDayNumber) 
   //sampleEnd
}