breejs / later

*Maintained fork of Later.* A javascript library for defining recurring schedules and calculating future (or past) occurrences for them. Includes support for using English phrases and Cron schedules. Works in Node and in the browser.
https://breejs.github.io/later/
MIT License
134 stars 13 forks source link

[discussion] How do I parse a later schedule into CRON? #21

Open JackEdwardLyons opened 2 years ago

JackEdwardLyons commented 2 years ago

What would you like to discuss?

I'm wondering how I can convert a later schedule into cron format? For example:

const everyNthDays = later.parse.recur().every(12).dayOfMonth();
const dayOccurs = later.schedule(everyNthDays).next(5);
console.log({ everyNthDays });

// how to convert to cron??

Checklist

If it's not possible with laterjs, do you have any recommended libraries that could help?

Thank you

ccollie commented 4 months ago

@JackEdwardLyons Did you ever find a way to handle this ?