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

Time change isn't handled correctly #17

Open
yahrens opened this issue Jul 8, 2013 · 2 comments
Open

Time change isn't handled correctly #17

yahrens opened this issue Jul 8, 2013 · 2 comments
Labels

Comments

@yahrens
Copy link
Contributor

yahrens commented Jul 8, 2013

When switching to DST ("Sommerzeit") in Europe/Berlin 2:30AM must not occur.

Test-rule:

FREQ=YEARLY;UNTIL=20200101T010101Z;BYMONTH=3;BYDAY=-1SU;BYHOUR=2;BYMINUTE=30

Test-case:

mTestRules.add(new TestRule("FREQ=YEARLY;UNTIL=20200101T010101Z;BYMONTH=3;BYDAY=-1SU;BYHOUR=2;BYMINUTE=30")
            .setStart("20120101T010101", "Europe/Berlin").setInstances(1));

Right now we get 9 instead of 1.

@gwijdegeenens
Copy link

This test rule describes the following :
Frequency : Jaarlijks
The last Sundag of the 3Rd month at 2:30 (UTC tijd)
Start 2012-01-01 01:01:01
End 2020-01-01 01:01:01

This should give the following 9 Dates instances
2012-01-01 // Start date is alway included
2012-03-25
2013-03-31
2014-03-30
2015-03-29
2016-03-27
2017-03-26
2018-03-25
2019-03-31

So I think 9 is a correct answer.
The .setInstances(1) is maybe wrong and that is maybe the reason why this test is in comment.

@dmfs
Copy link
Owner

dmfs commented Jun 17, 2019

The test specifies "Europe/Berlin" as the start time zone and the recurrence rule specifies the days at which the DST change occurs. On these days the clock is set forward from 2:00 to 3:00, so 2:30 is not a valid time. The general question is, how do we handle this case. Should we just generate these days (like we do currently)? Or should we skip them? Or should we throw an exception?

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

3 participants