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.
// My value.scheduled_date is 2018-09-06
var d = new Date(value.scheduled_date);
var day = d.getDate();
// month count will be -1 as it starts from 0
var month = d.getMonth();
var year = d.getFullYear();
var recurSched = later.parse.recur().on(day).dayOfMonth().every(3).month();
var schedules = later.schedule(recurSched).next(5);
console.log(schedules)
This gives 3 months recurrence starting from the current month, but I want the recurrence to start from the scheduled_date. When I add starting On to the code
var recurSched = later.parse.recur().on(day).dayOfMonth().every(3).month().startingOn(month + 1);
var schedules = later.schedule(recurSched).next(5);
console.log(schedules)
Recurrence is staring only after that month for every year. I want recurrence to start from a particular date so that the recurrence of other years won't be affected.
The same is the case with my 6 months code
var recurSched = later.parse.recur().on(day).dayOfMonth().every(6).month().startingOn(month+1);
var schedules = later.schedule(recurSched).next(5);
console.log(schedules);
I am trying to create recurrence every 3 and 6 months using the later.js(https://github.com/bunkat/later).
This is my code
This gives 3 months recurrence starting from the current month, but I want the recurrence to start from the scheduled_date. When I add starting On to the code
Recurrence is staring only after that month for every year. I want recurrence to start from a particular date so that the recurrence of other years won't be affected.
The same is the case with my 6 months code