Closed alexmirash closed 5 months ago
//this usage variand leads to issue implementation(libs.cron.utils) implementation(libs.threetenabp) -- this library seems to contain issue //this variant does not contain this problem implementation(libs.cron.utils.v920)
//issue test case
private fun test() { val cronString = "0 0 23 ? *" val parser = CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ)) val executionTime = ExecutionTime.forCron(parser.parse(cronString)) val time = ZonedDateTime.of(2024, 3, 31, 21, 59, 30, 0, ZoneId.systemDefault()) val nextTime = executionTime.nextExecution(time) val timeToNextExecution = executionTime.timeToNextExecution(time) Log.d(TAG, "time=$time") Log.d(TAG, "nextTime=$nextTime") Log.d(TAG, "timeToNextExecution=$timeToNextExecution") } //output time=2024-03-31T21:59:30+03:00[Europe/Kiev] nextTime=Optional.of(2024-03-01T23:00+02:00[Europe/Kiev]) timeToNextExecution=Optional.of(PT-717H-59M-30S)