core / io.islandtime.operators

Package io.islandtime.operators

A set of convenience operators for various date-time primitives, enabling things like date.next(TUESDAY), date.startOfWeek, or dateTime.truncatedToMilliseconds().

Properties

(iosArm64, iosX64, jvm, macosX64)

endOfMonth

The date at the end of the month that this date falls in.

val Date.endOfMonth: Date

The date-time at the last representable instant of the month that this date-time falls in.

val DateTime.endOfMonth: DateTime
val OffsetDateTime.endOfMonth: OffsetDateTime
val ZonedDateTime.endOfMonth: ZonedDateTime
(iosArm64, iosX64, jvm, macosX64)

endOfWeek

The date at the end of the ISO week that this date falls in.

val Date.endOfWeek: Date

The date-time at the last representable instant of the ISO week that this date-time falls in.

val DateTime.endOfWeek: DateTime
val OffsetDateTime.endOfWeek: OffsetDateTime
val ZonedDateTime.endOfWeek: ZonedDateTime
(iosArm64, iosX64, jvm, macosX64)

endOfYear

The date at the end of the year that this date falls in.

val Date.endOfYear: Date

The date-time at the last representable instant of the year that this date-time falls in.

val DateTime.endOfYear: DateTime
val OffsetDateTime.endOfYear: OffsetDateTime
val ZonedDateTime.endOfYear: ZonedDateTime
(iosArm64, iosX64, jvm, macosX64)

startOfMonth

The date at the start of the month that this date falls in.

val Date.startOfMonth: Date

The date-time at the first instant of the month that this date-time falls in.

val DateTime.startOfMonth: DateTime
val OffsetDateTime.startOfMonth: OffsetDateTime
val ZonedDateTime.startOfMonth: ZonedDateTime
(iosArm64, iosX64, jvm, macosX64)

startOfWeek

The date at the start of the ISO week that this date falls in.

val Date.startOfWeek: Date

The date-time at the first instant of the ISO week that this date-time falls in.

val DateTime.startOfWeek: DateTime
val OffsetDateTime.startOfWeek: OffsetDateTime
val ZonedDateTime.startOfWeek: ZonedDateTime
(iosArm64, iosX64, jvm, macosX64)

startOfYear

The date at the start of the year that this date falls in.

val Date.startOfYear: Date

The date-time at the first instant of the year that this date-time falls in.

val DateTime.startOfYear: DateTime
val OffsetDateTime.startOfYear: OffsetDateTime
val ZonedDateTime.startOfYear: ZonedDateTime

Functions

(iosArm64, iosX64, jvm, macosX64)

next

The next date after this one that falls on a particular day of the week.

fun Date.next(dayOfWeek: DayOfWeek): Date

The next date-time after this one that falls on a particular day of the week.

fun DateTime.next(dayOfWeek: DayOfWeek): DateTime
fun OffsetDateTime.next(dayOfWeek: DayOfWeek): OffsetDateTime
fun ZonedDateTime.next(dayOfWeek: DayOfWeek): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64)

nextOrSame

The next date that falls on a particular day of the week, or this one if it falls on the same day.

fun Date.nextOrSame(dayOfWeek: DayOfWeek): Date

The next date-time that falls on a particular day of the week, or this one if it falls on the same day.

fun DateTime.nextOrSame(dayOfWeek: DayOfWeek): DateTime
fun OffsetDateTime.nextOrSame(dayOfWeek: DayOfWeek): OffsetDateTime
fun ZonedDateTime.nextOrSame(dayOfWeek: DayOfWeek): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64)

previous

The last date before this one that falls on a particular day of the week.

fun Date.previous(dayOfWeek: DayOfWeek): Date

The last date-time before this one that falls on a particular day of the week.

fun DateTime.previous(dayOfWeek: DayOfWeek): DateTime
fun OffsetDateTime.previous(dayOfWeek: DayOfWeek): OffsetDateTime
fun ZonedDateTime.previous(dayOfWeek: DayOfWeek): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64)

previousOrSame

The last date that falls on a particular day of the week, or this one if it falls on the same day.

fun Date.previousOrSame(dayOfWeek: DayOfWeek): Date

The last date-time that falls on a particular day of the week, or this one if it falls on the same day.

fun DateTime.previousOrSame(dayOfWeek: DayOfWeek): DateTime
fun OffsetDateTime.previousOrSame(dayOfWeek: DayOfWeek): OffsetDateTime
fun ZonedDateTime.previousOrSame(dayOfWeek: DayOfWeek): ZonedDateTime
(iosArm64, iosX64, jvm, macosX64)

truncatedToHours

Return a copy of this time, truncated to the hour value. All smaller components will be replaced with zero.

fun Time.truncatedToHours(): Time
fun OffsetTime.truncatedToHours(): OffsetTime

Return a copy of this date-time, truncated to the hour value. All smaller components will be replaced with zero.

fun DateTime.truncatedToHours(): DateTime
fun ZonedDateTime.truncatedToHours(): ZonedDateTime
fun OffsetDateTime.truncatedToHours(): OffsetDateTime
(iosArm64, iosX64, jvm, macosX64)

truncatedToMicroseconds

Return a copy of this time with the nanosecond value truncated to microseconds.

fun Time.truncatedToMicroseconds(): Time
fun OffsetTime.truncatedToMicroseconds(): OffsetTime

Return a copy of this date-time with the nanosecond value truncated to microseconds.

fun DateTime.truncatedToMicroseconds(): DateTime
fun ZonedDateTime.truncatedToMicroseconds(): ZonedDateTime
fun OffsetDateTime.truncatedToMicroseconds(): OffsetDateTime
(iosArm64, iosX64, jvm, macosX64)

truncatedToMilliseconds

Return a copy of this time with the nanosecond value truncated to milliseconds.

fun Time.truncatedToMilliseconds(): Time
fun OffsetTime.truncatedToMilliseconds(): OffsetTime

Return a copy of this date-time with the nanosecond value truncated to milliseconds.

fun DateTime.truncatedToMilliseconds(): DateTime
fun ZonedDateTime.truncatedToMilliseconds(): ZonedDateTime
fun OffsetDateTime.truncatedToMilliseconds(): OffsetDateTime
(iosArm64, iosX64, jvm, macosX64)

truncatedToMinutes

Return a copy of this time, truncated to the minute value. All smaller components will be replaced with zero.

fun Time.truncatedToMinutes(): Time

Return a copy of this date-time, truncated to the minute value. ll smaller components will be replaced with zero.

fun DateTime.truncatedToMinutes(): DateTime
fun OffsetDateTime.truncatedToMinutes(): OffsetDateTime

Return a copy of this date-time, truncated to the minute value. All smaller components will be replaced with zero.

fun ZonedDateTime.truncatedToMinutes(): ZonedDateTime

Return a copy of this time, truncated to the minute value. ll smaller components will be replaced with zero.

fun OffsetTime.truncatedToMinutes(): OffsetTime
(iosArm64, iosX64, jvm, macosX64)

truncatedToSeconds

Return a copy of this time, truncated to the second value. All smaller components will be replaced with zero.

fun Time.truncatedToSeconds(): Time
fun OffsetTime.truncatedToSeconds(): OffsetTime

Return a copy of this date-time, truncated to the second value. All smaller components will be replaced with zero.

fun DateTime.truncatedToSeconds(): DateTime
fun ZonedDateTime.truncatedToSeconds(): ZonedDateTime
fun OffsetDateTime.truncatedToSeconds(): OffsetDateTime