0

In java application i have to specify recurring periods just like we schedule recurring meetings in outlook.

Some examples are

Recurring every Monday from 10:30 to 12:00

Recurring every Sunday from 23:00 to 05:00.

Is there any library to specify such recurring periods in java, and get all possible periods(start date,end date). My intend is to check one Date and see whether it inside any of the recurring periods.

I tried this with cron expression, but there we can't specify the hour and minutes together. Also I think it's primary intend is to define the execution start time, and concept of period is missing there.

Jomy
  • 23
  • 6
  • There are a few, but as described your requirements basically boil down to `now.getDayOfWeek() == recursEvery && !now.toLocalTime().isBefore(startTime) && now.toLocalTime().isBefore(endTime)`. – shmosel Jun 07 '23 at 04:26
  • Thanks shmosel, the examples I have given are just 2 scenarios, there can be other options it should support just like what we can do in outlook. So I would like to know if there any library available to handle this, as I don't have to build custom logic for the same. – Jomy Jun 07 '23 at 04:34

0 Answers0