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

Possible recur bug? #690

Open
douglm opened this issue May 14, 2024 · 1 comment
Open

Possible recur bug? #690

douglm opened this issue May 14, 2024 · 1 comment

Comments

@douglm
Copy link
Contributor

douglm commented May 14, 2024

Describe the bug
Below is the code in Recur related to UNTIL

        } else if (UNTIL.equals(token)) {
            final String untilString = nextToken(tokens, token);
            if (untilString != null && untilString.contains("T")) {
                until = new DateTime(untilString);
                // UNTIL must be specified in UTC time..
                ((DateTime) until).setUtc(true);
            } else {
                until = new Date(untilString);
            }

It sets the DateTime to UTC always. However, RFC5545 says

The value of the UNTIL rule part MUST have the same
value type as the "DTSTART" property. Furthermore, if the
"DTSTART" property is specified as a date with local time, then
the UNTIL rule part MUST also be specified as a date with local
time. If the "DTSTART" property is specified as a date with UTC
time or a date with local time and time zone reference, then the
UNTIL rule part MUST be specified as a date with UTC time.

So if the DTSTART has no timezone (floating time) the value should NOT be UTC

If I'm right, this seems to add a lot of complication as we need the DTSTART to determine the correct type for UNTIL.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: [e.g. Windows, Linux, Android]
  • Java Version [e.g. 7, 8, 9]
  • iCal4j Version

Additional context
Add any other context about the problem here.

@benfortuna
Copy link
Member

Thanks @douglm , well spotted! This looks like some of the earliest code (git blame tells me 2005!), so I may have read the spec wrong.

Interestingly this is removed in the v4 branch, I can't recall why I didn't fix it for 3.x also. I'll put the fix in now.

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