Using Quartz.NET, I'm trying to create a trigger that:
- starts September 30th,
- repeats on the last day
- of every 5 months.
- be able to use
ITrigger.GetFireTimeAfter()
to compute/project the next fire times (UI feedback)
Expected:
- 2017-9-30
- 2018-2-28
- 2018-7-31
- 2018-12-31
I thought I could use a CronTrigger
(ie 0 0 0 L 9/5 ? *
)
But the projected days are:
- 2017-9-30
- 2018-9-30
- 2019-9-30
Could not use CalendarIntervalTrigger
either:
For example, if you choose a start time that occurs on January 31st, and have a trigger with unit Month and interval 1, then the next fire time will be February 28th, and the next time after that will be March 28th - and essentially each subsequent firing will occur on the 28th of the month, even if a 31st day exists. If you want a trigger that always fires on the last day of the month - regardless of the number of days in the month, you should use ICronTrigger
How can I schedule a trigger like this? Do I have to implement my own trigger and IScheduler from scratch? Or is there a way for me to inject in a custom calculation?
Thanks
See Question&Answers more detail:os