Compare commits

...

2 Commits

2 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ internal fun NearDateTimeCalculatorDays(
times: Array<Byte> times: Array<Byte>
) = CommonNearDateTimeCalculator( ) = CommonNearDateTimeCalculator(
times, times,
{ (it.dayOfMonth - 1).toByte() }, { (it.dayOfMonth - 1).toByte() }, // index1, so, decrease
{ dateTime, newOne -> { dateTime, newOne ->
val dateTime = (if (newOne < dateTime.dayOfMonth) { val dateTime = (if (newOne < dateTime.dayOfMonth) {
dateTime.plus(1.months) dateTime.plus(1.months)

View File

@ -5,9 +5,9 @@ import com.soywiz.klock.days
import dev.inmo.krontab.buildSchedule import dev.inmo.krontab.buildSchedule
import kotlin.test.* import kotlin.test.*
class InfinityLoopCheckTest { class CheckMonthsAndDaysCorrectWork {
@Test @Test
fun absenceOfInfinityLoopCheckTest() { fun checkMonthsAndDaysCorrectWork() {
val now = DateTime.now().startOfYear.startOfDay val now = DateTime.now().startOfYear.startOfDay
for (i in 0 until now.year.days) { for (i in 0 until now.year.days) {
val scheduleDateTime = (now + i.days) val scheduleDateTime = (now + i.days)