Cron.prev method to get the last time that a cron ran
What is the problem this feature would solve?
This would allow a Cron instance to produce the last time that it would have triggered. This is useful if you're showing a UI that shows a progress bar of 'time till next run' and you want that to represent the time between cron invocations.
What is the feature you are proposing to solve the problem?
A method called Cron.prev, or internally, possibly a method that can calculate 'next' in both a forward and reverse time direction. This would also make computing a sequence of previous cron values possible.
What alternatives have you considered?
This is admittedly a niche issue, but there is precedent for this method in libraries like cron-parser.
Hello there, esteemed Cron enjoyor.
Agreed, this would be a good feature to add. Do you want to make this your first contribution to Effect?
Happy Cron'ing!
Sure! I'm interested. Giving it a shot here https://github.com/Effect-TS/effect/compare/main...tmcw:effect:cron-prev?expand=1 - but probably need to really proof this before opening a PR to make sure it handles all of the edges.