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

When useTimeZoneWithRRules is true and having a weekly occurrence something goes wrong #233

Closed
machfr opened this issue Aug 6, 2019 · 5 comments

Comments

@machfr
Copy link

machfr commented Aug 6, 2019

Hey
I have an issue when I set useTimeZoneWithRRules to true and I have a occurance weekly

ical = new ICal($response, array(
    'shouldFilterByWindow'		=> true,
    'windowMinTimestamp'		=> true,
    'filterDaysBefore'			=> 14,
    'filterDaysAfter'			=> 365,
    'replaceWindowsTimeZoneIds' => true,
    'useTimeZoneWithRRules'     => true,
));
BEGIN:VEVENT
DTSTART;TZID=Europe/Copenhagen:20190807T100000
DTEND;TZID=Europe/Copenhagen:20190807T113000
RRULE:FREQ=WEEKLY;BYDAY=WE
DTSTAMP:20190806T082820Z
UID:0ravk3521qkp7mbiffhlm0ab47@google.com
CREATED:20190806T082448Z
DESCRIPTION:
LAST-MODIFIED:20190806T082448Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:07-08-2019 - hver onsdag
TRANSP:OPAQUE
END:VEVENT

Then the first day aka. the 7th of august it will give us an event from 10:00 - 11:30 as it should, but at the same day it will show give us an event from 11:00 - 12:30 and all the next occurrences weekly will be from 11:00 - 12:30

So there is two issues here

  1. On the first day it will give us 2 events.
  2. On all the next occurrences it will show an hours wrong.
@u01jmg3 u01jmg3 self-assigned this Aug 6, 2019
@u01jmg3
Copy link
Owner

u01jmg3 commented Aug 6, 2019

Thanks for logging this issue.

Please bear with me. @s0600204 has kindly submitted PR #232 which I need to find time to review. This may fix your issue so feel free to test out the code.

If not, I am happy to accept a PR.

@u01jmg3 u01jmg3 changed the title When useTimeZoneWithRRules is true and having a weekly occurance something goes wrong When useTimeZoneWithRRules is true and having a weekly occurrence something goes wrong Aug 6, 2019
@s0600204
Copy link
Collaborator

s0600204 commented Aug 6, 2019

Looking into this, it seems to happen only if the timezone of the php environment is not UTC/GMT and useTimeZoneWithRRules is true. Setting php's timezone (via date_default_timezone_set()) to "UTC" or passing useTimeZoneWithRRules as false, appears to rectify the problem.


The aforementioned PR happens to remove the useTimeZoneWithRRules parameter entirely. So yeah: that also fixes the issue.

@machfr
Copy link
Author

machfr commented Aug 7, 2019

Seems like forcing it to UTC is working (I tried to set it to Europe/London which did not), will test some more with it

@u01jmg3
Copy link
Owner

u01jmg3 commented Aug 7, 2019

Closed by #232

@u01jmg3 u01jmg3 closed this as completed Aug 7, 2019
@u01jmg3 u01jmg3 added this to the v2.x.x milestone Aug 7, 2019
@s0600204
Copy link
Collaborator

s0600204 commented Aug 7, 2019

(Europe/London alternates between UTC and BST ("British Summer Time"; UTC+1) depending on the time of year. So in this case the recurrences that fall in winter will most likely have the correct time, those that fall in summer will not.)

@u01jmg3 u01jmg3 removed their assignment Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants