Skip to content

//core/io.islandtime.ranges/toPeriod

toPeriod

common

fun DateRange.toPeriod(): Period

Converts this range into a Period of the same length. As a range is inclusive, if the start and end date are the same, the resulting period will contain one day.

Throws

UnsupportedOperationException if the range isn't bounded

common

fun DateTimeInterval.toPeriod(): Period

fun OffsetDateTimeInterval.toPeriod(): Period

fun ZonedDateTimeInterval.toPeriod(): Period

Converts this interval into a Period of the same length.

Throws

UnsupportedOperationException if the interval isn't bounded