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

Fix bug in by year day #2

Merged
merged 1 commit into from
Sep 10, 2019
Merged

Fix bug in by year day #2

merged 1 commit into from
Sep 10, 2019

Conversation

valentinbonneaud
Copy link
Collaborator

You can observe the issue by generating occurences using the following rule: FREQ=YEARLY;COUNT=3;BYYEARDAY=1 and the following start date 2011-01-01 03:07:00. The currently generated times will be

[
    '2011-01-01 03:07:00',
    '2011-01-02 03:07:00',
    '2012-01-02 03:07:00',
]

instead of

[
    '2011-01-01 03:07:00',
    '2012-01-01 03:07:00',
    '2013-01-01 03:07:00',
]

The BYYEARDAY rule part specifies a COMMA-separated list of days of the year. Valid values are 1 to 366 or -366 to -1. For example, -1 represents the last day of the year (December 31st) and -306 represents the 306th to the last day of the year (March 1st). The BYYEARDAY rule part MUST NOT be specified when the FREQ rule part is set to DAILY, WEEKLY, or MONTHLY.

https://tools.ietf.org/html/rfc5545#section-3.3.10

Based on the RFC, BYYEARDAY=1 should return the first day of the year and not the second.

@valentinbonneaud valentinbonneaud merged commit 0c57be3 into master Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants