All day calendar events not detected on time

Post your questions and help other users.

Moderator: Martin

Post Reply
andi
Posts: 13
Joined: 22 May 2015 05:42

All day calendar events not detected on time

Post by andi » 22 May 2015 06:53

Hi

It looks like the event condition does not work with all day events. It does something weird with the time zone and misses the start / end of the event by x hours.

Setup:
It's 8h23, and I have an all day event in my birthday CalDAV calendar tomorrow.
I setup a condition for 17h before start, condition should be true, as 8h + 17h = 25h is well in tomorrow.

Observation:
I execute the condition manually and A4A return false.

Expectation:
I expect the condition to return true, as in 17h from now, I have this birthday event in the calendar.


Additional information:
- I don't see this issue for regular events
- in the (edited) log below, I see todays holiday event (in the Holiday calendar), but not tomorrows birthday event
- I'm puzzled by the "Adjust times of all day event using offsets", do we need this? My timezone is set to the time zone of my calendar
- if I set the condition to 18h before the event, I get "True" (but I don't want to do the time zone calculation myself)



22.05.2015 08:23:06.844 Debug Log active
22.05.2015 08:23:10.744 Execution context acquire
22.05.2015 08:23:10.748 [Manual Test] Start executing condition 'Calendar Event: Calendars: CalDAV:Birthdays (17h before start, 5m after end)'
22.05.2015 08:23:10.808 [Manual Test] Condition 'Calendar Event: Calendars: CalDAV:Birthdays (17h before start, 5m after end)' checking date range = Fri May 22 08:18:10 CEST 2015 to Sat May 23 01:23:10 CEST 2015
22.05.2015 08:23:10.934 Adjusted the times of the all day event using offsets 7200000/7200000 for timezone Europe/Zurich from Fri 22.05.2015 02:00:00.000-Sat 23.05.2015 02:00:00.000 to Fri 22.05.2015 00:00:00.000-Sat 23.05.2015 00:00:00.000
22.05.2015 08:23:10.937 Adjusted the times of the all day event using offsets 7200000/7200000 for timezone Europe/Zurich from Fri 22.05.2015 02:00:00.000-Sat 23.05.2015 02:00:00.000 to Fri 22.05.2015 00:00:00.000-Sat 23.05.2015 00:00:00.000
22.05.2015 08:23:10.950 [Manual Test] Condition 'Calendar Event: Calendars: CalDAV:Birthdays (17h before start, 5m after end)' Found 7 potential events: [CalendarEventInstance{accountTypeName='CalDAV', calendarDisplayName='Holiday', start=1432245600000(Fri 22.05.2015 00:00:00.000), end=1432332000000(Sat 23.05.2015 00:00:00.000), title='Holiday', description='', eventLocation='', allDay=true, availability=FREE}]
22.05.2015 08:23:10.950 [Manual Test] Condition 'Calendar Event: Calendars: CalDAV:Birthdays (17h before start, 5m after end)' Going to evaluate calendar name filter: CalDAV:Birthdays
22.05.2015 08:23:10.952 [Manual Test] End executing condition 'Calendar Event: Calendars: CalDAV:Birthdays (17h before start, 5m after end)' with return value false
22.05.2015 08:23:10.973 Execution context release
22.05.2015 08:23:10.974 Disposing execution context
22.05.2015 08:23:10.976 Removed wake lock tracker [Manual Test]
22.05.2015 08:23:10.977 Releasing wake lock tracker [Manual Test]

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: All day calendar events not detected on time

Post by Martin » 23 May 2015 12:36

Hi,

I see what happens, unfortunately this really seems to be a bug in Automagic.
The Android calendar stores all day events in midnight UTC so your all day events look like they don't start at midnight but shifted by the local timezone offset (2 hours at the moment). That's the reason Automagic has to shift the all day events by your offset since you expect that the all day event actually start/end at midnight in your timezone.
Unfortunately this shifting happens only when providing the variables about the event to the flow but not when the calendar is queried which means that the event can not (yet) be found.

I'll try to include a fix for this in the next EAP version.

Thanks for reporting!

Regards,
Martin

andi
Posts: 13
Joined: 22 May 2015 05:42

Re: All day calendar events not detected on time

Post by andi » 26 May 2015 16:22

Thanks, looking forward for the new version.

Andi

Post Reply