Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Каждый день
- const scheduleBuilder = later.parse.recur().every(1).dayOfMonth();
- // {"schedules":[{"D":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]}],"exceptions":[]}
- // Каждый вторник
- const scheduleBuilder = later.parse.recur().every(1).dayOfMonth().on(3).dayOfWeek();
- // {"schedules":[{"D":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],"d":[3]}],"exceptions":[]}
- //Раз в месяц
- const scheduleBuilder = later.parse.recur().every(1).dayOfMonth();
- // {"schedules":[{"D":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]}],"exceptions":[]}
- const schedule = {
- schedules: scheduleBuilder.schedules,
- exceptions: scheduleBuilder.exceptions
- };
- console.log(JSON.stringify(schedule));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement