Wrong end date on "create appointment" action

32 views
Skip to first unread message

Hannes

unread,
Apr 27, 2016, 3:53:33 PM4/27/16
to Tasker
Hi,

when I create an all-day appointment then the end date is set to yesterday.
I can't figure out how to configure this. What am I doing wrong?

I'm using Owncloud and CalDAV, and the appointments get synced and displayed perfectly.
But Business Calendar 2 on Android don't show these appointments, maybe they get rendered with "negative length" ;-)



What can I do to change this?

Thanks,

Hannes
Auto Generated Inline Image 1

Rich D

unread,
Apr 28, 2016, 5:54:31 AM4/28/16
to Tasker Google Groups Post


> when I create an all-day appointment then the end date is set to yesterday.

This does not happen on my device.  Could you post the relevant profile and task exported descriptions?

To post your profile or task here...  Long press on the profile or task name / ( 3 dot menu with 4.0+ ) export / export "DESCRIPTION" to clipboard (not XML)

Any linked tasks will be exported with the profile they are linked to..

To be able to export, The beginner mode needs to be off and the profile needs to be named by you (Not the Tasker listed name.  Tasker will list your profile with the context name if you have not given it one).

Hannes

unread,
Apr 28, 2016, 5:06:28 PM4/28/16
to Tasker
The profile export looks like this (it's exported in German, I'll post it untranslated here):

Profil: Location Firma (11)
        Status: WiFi Verbunden [ SSID:Muhbla/Muhbla/Muhbla MAC:* IP:* ]
Eingang: FirmaAnkunft (8)
        A1: Neuer Termin [ In / Für (Minuten): Kalender:Google:Firma(firma) Titel:Ankunft %TIME Beschreibung: Standort: Verfügbar:Aus Ganztags:An ]

Ausgang: FirmaAbflug (10)
        A1: Neuer Termin [ In / Für (Minuten): Kalender:Google:Firma(firma) Titel:Abflug %TIME Beschreibung: Standort: Verfügbar:Aus Ganztags:An ]

What catches my eye is that all calendars in the dropdown list are prefixed with "Google:" regardless of whether the calendars are in my Google account or in the OC account. The affected calendar is an OC calendar shared to me by an account named "firma", therefore this doubled name "Firma(firma)". Maybe this is of interest somehow.

/Hannes

Rich D

unread,
Apr 28, 2016, 9:43:13 PM4/28/16
to Tasker Google Groups Post


> What catches my eye is that all calendars in the dropdown list are prefixed with "Google:" regardless of whether the calendars are in my Google account or in the OC account. The affected calendar is an OC calendar shared to me by an account named "firma", therefore this doubled name "Firma(firma)". Maybe this is of interest somehow.

Not sure if that is a issue or not. 

Does this happen on all the calendars?

Hannes

unread,
Apr 29, 2016, 2:00:03 AM4/29/16
to Tasker
It happens with Google calendar too, but it's rather difficult to recognize there. Google colors the end date with slight red background and shows the correct end date instead, but the Android calendar app "Business calendar" shows the real end date (yesterday).

It seems, that most of the calendar applications correct the wrong end date without notification (aside from Google's red background), OC complains about wrong end date when re-saving the event, BC@Android shows the wrong end date without complaining, and BC2@Android simply dont show the event at all.




I've exported two events in ICS format, one from Tasker and one created by OC itself.
It seems that the Tasker event really has the wrong end date (same date as start), whereas the OC event has the end date "+24h" (what seems right to me).

OC event:
BEGIN:VEVENT
CREATED:20160429T074749
DTSTAMP:20160429T074749
LAST-MODIFIED:20160429T074749
UID:movl7tprwh
SUMMARY:test
DTSTART;TZID=Europe/Berlin;VALUE=DATE:20160429
DTEND;TZID=Europe/Berlin;VALUE=DATE:20160430
END:VEVENT

Tasker event:
BEGIN:VEVENT
DTSTART;VALUE=DATE:20160428
SUMMARY:Abflug 18.53
TRANSP:OPAQUE
STATUS:CONFIRMED
DTEND;VALUE=DATE:20160428
LAST-MODIFIED:20160428T165428Z
DTSTAMP:20160428T165428Z
CREATED:20160428T165428Z
UID:5604151b-fd04-46ff-99ef-b09576d71de7.1461862468054
END:VEVENT

Maybe there's some sort of bug in Tasker's calendar event creation? ;-)
Auto Generated Inline Image 1

Rich D

unread,
Apr 29, 2016, 5:42:30 AM4/29/16
to Tasker Google Groups Post


> It happens with Google calendar too, but it's rather difficult to recognize there. Google colors the end date with slight red background and shows the correct end date instead,

I do not get the red tint on my device. Are you viewing that on a PC or mobile device?



It seems, that most of the calendar applications correct the wrong end date without notification (aside from Google's red background), OC complains about wrong end date when re-saving the event, BC@Android shows the wrong end date without complaining, and BC2@Android simply don't show the event at all.
>
>
>

> Maybe there's some sort of bug in Tasker's calendar event creation? ;-)
>

Perhaps.   There is a known bug with tasker and all day events I posted here

https://groups.google.com/forum/m/?hl=en#!forum/tasker

@Pent.   I found this info on stack overflow.  Perhaps this could be the issue for both bugs?

A couple ideas:

time zone "independence" of all-day events (treated as if having GMT) [1] [2]
international date line
[1]"If allDay is set to 1 eventTimezone must be TIMEZONE_UTC and the time must correspond to a midnight boundary."

[2]http://developer.android.com/reference/android/provider/CalendarContract.Events.html

Here is the link

http://stackoverflow.com/questions/14291091/android-calendar-all-day-event-dates-are-off-by-one-day-for-gmt-x-areas

Hannes

unread,
Apr 29, 2016, 6:06:18 PM4/29/16
to Tasker

I do not get the red tint on my device. Are you viewing that on a PC or mobile device?

This screenshot was taken on a PC using Firefox.

Hannes

unread,
May 1, 2016, 7:00:46 AM5/1/16
to Tasker

Perhaps.   There is a known bug with tasker and all day events I posted here

...
http://stackoverflow.com/questions/14291091/android-calendar-all-day-event-dates-are-off-by-one-day-for-gmt-x-areas

Is there anything I can do to work around that?

Rich D

unread,
May 1, 2016, 9:22:32 AM5/1/16
to Tasker Google Groups Post


> Is there anything I can do to work around that?
>

The way I did it was instead of setting a all day event I set a calendar event with the time from 12:01 am to 11:59 pm

I can dig out the code I used if you need it.  Use the variable convert action to get time in seconds from the date.

Rich D

unread,
May 1, 2016, 5:52:07 PM5/1/16
to Tasker Google Groups Post


> I can dig out the code I used if you need it.  Use the variable convert action to get time in seconds from the date.

Here is a example of how to set the current day to a all day event


Set All Day Alt (770)
A1: Variable Set [ Name:%date To:%DATE 00:01 Do Maths:Off Append:Off ]
A2: Variable Convert [ Name:%date Function:Date Time to Seconds Store Result In:%date ]
A3: Variable Set [ Name:%min To:floor(((%date)-%TIMES)/60) Do Maths:On Append:Off ]
A4: Calendar Insert [ In / For (Minutes):%min/1420 Calendar:Google:ricp...@gmail.com Title:test day off Description: Location: Available:Off All Day:Off Continue Task After Error:On ]

Hannes

unread,
May 2, 2016, 2:49:21 AM5/2/16
to Tasker
Set All Day Alt (770)

A1: Variable Set [ Name:%date To:%DATE 00:01 Do Maths:Off Append:Off ]
A2: Variable Convert [ Name:%date Function:Date Time to Seconds Store Result In:%date ]
A3: Variable Set [ Name:%min To:floor(((%date)-%TIMES)/60) Do Maths:On Append:Off ]

A4: Calendar Insert [ In / For (Minutes):%min/1420 Calendar:Goo...@gmail.com Title:test day off Description: Location: Available:Off All Day:Off Continue Task After Error:On ]


Thank you.
These events get displayed as all-day long bars instead of single small records in the all-day section in the calendar view (Owncloud web frontend and Kontact), so this isn't very practical, but your code is helpful anyway.
Reply all
Reply to author
Forward
0 new messages