money.rave.common.backend.date.ZonedDateTimeProgressionIterator.kt Maven / Gradle / Ivy
package money.rave.common.backend.date
import java.time.Duration
import java.time.ZonedDateTime
class ZonedDateTimeProgressionIterator(
first: ZonedDateTime,
private val last: ZonedDateTime,
private val step: Duration,
) : Iterator {
private var current: ZonedDateTime = first
override fun hasNext(): Boolean = current <= last
override fun next(): ZonedDateTime {
val c = current
current += step
return c
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy