All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.utils.flows.DateTimeTzWhen.kt Maven / Gradle / Ivy

The newest version!
package dev.inmo.krontab.utils.flows

import korlibs.time.*
import kotlinx.coroutines.flow.Flow

@Suppress("NOTHING_TO_INLINE")
inline fun Flow.onlyStartsOfMinutes() = filterSeconds(0)

@Suppress("NOTHING_TO_INLINE")
inline fun Flow.onlyStartsOfHours() = filterMinutes(0).onlyStartsOfMinutes()

@Suppress("NOTHING_TO_INLINE")
inline fun Flow.onlyStartsOfDays() = filterHours(0).onlyStartsOfHours()

@Suppress("NOTHING_TO_INLINE")
inline fun Flow.onlyStartsOfMondays() = filterWeekDays(DayOfWeek.Monday).onlyStartsOfDays()

@Suppress("NOTHING_TO_INLINE")
inline fun Flow.onlyStartsOfSundays() = filterWeekDays(DayOfWeek.Sunday).onlyStartsOfDays()

@Suppress("NOTHING_TO_INLINE")
inline fun Flow.onlyStartsOfMonths() = filterDaysOfMonths(1).onlyStartsOfDays()

@Suppress("NOTHING_TO_INLINE")
inline fun Flow.onlyStartsOfYears() = filterMonths(Month.January).onlyStartsOfMonths()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy