Open arnthorsnaer opened 7 years ago
It's not meant to do that. A standard Javascript timer would be better for that, since execution is relative to the time it was set.
@MaxMem thanks for comment.
The thing is that I have a few scheduling options available to the user, and as it stands they are all implemented with the later.js and the schedule data structure. Having to use completely new code and new data structures to manage what is essentially a list of occurrences seems pretty messy.
Anyways, I can't use a timer for this since this will be evaluated somewhere else.
Generating the list of dates is pretty easy - adding the dates to the schedules datastructure is the tricky part.
I'm wondering if I could write a custom modifier to achive this.
I think a every(9).day()
time period pattern would make a lot of sense. I feel like a custom modifier could be written that increments the day value of a Date by 1. A lot of logic would need to be written to handle time periods between months, between years, in leap years, etc... But I don't think it's out of the realm of possibility. This would be something like .recur().every(9, "days")
in moment-recur
Assuming any day, for example today's date. How do I create a schedule with occurances on every 9 days from today?
This sounds like a pretty basic question, but I've been reading the docs and trying some code and can't figure this out...