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
136 stars 13 forks source link

Support L-{number} on day component #3

Open thefat32 opened 4 years ago

thefat32 commented 4 years ago

Support Quartz syntax "L-{number}" as "{number} days before month end"

Example:

0 14 L-3 * ?

Should evaluate 3 days before each month ends

Next 5 executions from today:

09/27/2020 14:00:00
10/28/2020 14:00:00
11/27/2020 14:00:00
12/28/2020 14:00:00
01/28/2021 14:00:00

Reference from quartz-scheduler docs:

You can also specify an offset from the last day of the month, such as "L-3" which would mean the third-to-last day of the calendar month.