Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android: EXDATE format when adding a calendar event

Can someone explain how to use EXDATE when adding event to android calendar? The documentation is pretty unclear about the format in which the EXDATE should be put. I tried many formats, these are some of them:

values.put(Events.EXDATE, "TZID=Europe/London:20130116T080000");
values.put(Events.EXDATE, "20130116T080000Z");
values.put(Events.EXDATE, "20130116T080000");
values.put(Events.EXDATE, "20130116");

but none of them works. Any idea how to make an event not appear on a particular date, if by the RRULE it should appear?

like image 749
nikmin Avatar asked Jan 25 '13 13:01

nikmin


2 Answers

The correct format is:

values.put(Events.EXDATE, "20130116T080000Z");

However you must ensure that it is in UTC time. I was having the same problem starting from PST, so I just had to add 8 hours to get it to work.

like image 56
kee23 Avatar answered Nov 03 '22 14:11

kee23


In addition to the @kee23's answer, the next variant is valid for multiple EXDATE values:

contentValues.put(CalendarContract.Events.EXDATE, "20130116T080000Z,20130118T080000Z");
like image 41
ilyamuromets Avatar answered Nov 03 '22 14:11

ilyamuromets