Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every 3 and 6 Months Recurrence on later.js stating from a particular date #232

Open
aravind2base opened this issue Jun 6, 2018 · 0 comments

Comments

@aravind2base
Copy link

I am trying to create recurrence every 3 and 6 months using the later.js(https://github.com/bunkat/later).

This is my code

// 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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant