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

Falsely matching recurring days #70

Open
pacobalt opened this issue May 9, 2017 · 1 comment
Open

Falsely matching recurring days #70

pacobalt opened this issue May 9, 2017 · 1 comment
Labels

Comments

@pacobalt
Copy link

pacobalt commented May 9, 2017

When I want to match a day with e.g. the last day of a month that has only 30 days, the method "matches" will return a false "true"

const rc = moment("2017-04-30").recur().every(1,"months");
console.log(rc.matches("05/30/2017")); //true
console.log(rc.matches("05/31/2017")); //true

Is this a bug? Or am I doing something wrong here? This is only happening, if the recurring start date is the last of a 30 day month or if we choose the last of February and match it with any other day of the month higher than 28.

@c-trimm
Copy link
Owner

c-trimm commented Jul 18, 2017

This should only be happening on the dayOfMonth calendar interval (where it assumes that you want the last day of the month if the date you select is the last day of the month). We should make this an explicit option, though, and not have it happen by default...

Marking this as a bug to be investigated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants