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

NextInstance skips dates #5

Closed
aliciagontarek opened this issue May 2, 2017 · 2 comments
Closed

NextInstance skips dates #5

aliciagontarek opened this issue May 2, 2017 · 2 comments

Comments

@aliciagontarek
Copy link

If a start date is on the 29th and the NextInstance falls in Feb (based on frequency), that month will be skipped if not a Leap Year. For example, start date is 5/29/17, frequency is 9 months, the next instance displayed is 11/29/18. It also does this if the start date is 2/29 and frequency is yearly, it will only return the leap years. I was able to work around this by setting a ByMonthDay -1 for that scenario, but monthly frequency is more difficult.

@EWSoftware
Copy link
Owner

This is by design per the specification. If BYxxx rule parts are found that exceed the available scope (in this case Feb 29th in a non-leap year), the instances are ignored. To handle this, you can use the BYSETPOS rule to get the last occurrence that falls on either the 28th or 29th. For example:

FREQ=MONTHLY;INTERVAL=9;BYMONTHDAY=28,29;BYSETPOS=-1

Here, BYMONTHDAY=28,29 computes the 28th and 29th at the given monthly interval and BYSETPOS=-1 limits it to the last in the set. For February of non-leap years, that will be the 28th and for all other months, it will be the 29th.

@aliciagontarek
Copy link
Author

aliciagontarek commented May 2, 2017 via email

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

2 participants