bunkat / 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.
http://bunkat.github.io/later/
MIT License
2.42k stars 245 forks source link

How to customize weekOfMonth to get week starting on Monday #240

Open ranouf opened 3 years ago

ranouf commented 3 years ago

Hi,

In my app, the first day of the week is monday, so when I call:

  var scheduler = later.parse.recur();
  scheduler.on(1).weekOfMonth();
  later.date.localTime();
  var result = later.schedule(scheduler).next(1);

the result is not matching with what I m expecting as later starts the week on sunday.

How could I customize later or weekOfMonth to set Monday as the fist day of the week?

Thanks