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

1 Month interval starting on 28th Feb #41

Open
jamesskinner opened this issue Sep 29, 2015 · 5 comments
Open

1 Month interval starting on 28th Feb #41

jamesskinner opened this issue Sep 29, 2015 · 5 comments

Comments

@jamesskinner
Copy link

I am seeing weird results when starting a 1 month interval on 28th Feb. The recurrence matches any date >= 28 and <= 31. For example:

var r =  moment.utc('2015-02-28T00:00:00.000Z').recur().every(1, 'month');
console.log(r.matches(moment.utc('2015-08-27T00:00:00Z'))); // false
console.log(r.matches(moment.utc('2015-08-28T00:00:00Z'))); // true
console.log(r.matches(moment.utc('2015-08-29T00:00:00Z'))); // true
console.log(r.matches(moment.utc('2015-08-30T00:00:00Z'))); // true
console.log(r.matches(moment.utc('2015-08-31T00:00:00Z'))); // true
console.log(r.matches(moment.utc('2015-09-01T00:00:00Z'))); // false

The same does not happen if the recurrence is started on 28th of a different month.

I have seen #4 but this seems like a different issue.

@jamesskinner
Copy link
Author

Looks like this is an issue with moment.diff - I have raided it in moment/moment#2642

@jamesskinner
Copy link
Author

...looks like the aforementioned issue in moment.diff is not considered a bug. This issue still stands though I think.

@cyri113
Copy link

cyri113 commented Mar 29, 2016

Hi James - any solution to this yet? I am having the same problem atm.

@jamesskinner
Copy link
Author

@cderche In the end the solution was to use later.js which is working well.

@niftylettuce
Copy link
Contributor

I use simple-recur as later did not work for me.

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

3 participants