Some of deleted occurrence of recurring event doesn't comes under EXDATE - icalendar

BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
SUMMARY:Test
TRANSP:OPAQUE
ATTENDEE;CUTYPE=INDIVIDUAL;EMAIL=a#icloud.com;PARTSTAT=ACCEPTED;
ROLE=CHAIR;CN=a:/aMzg2Mzc2MTQzODYzNzYxNBljuJkfI_9Sr7UoBKqc9uB4hzRY_BLyjaYyqorZZI2N/principal/
ATTENDEE;CUTYPE=INDIVIDUAL;EMAIL=jag#icloud.com;
PARTSTAT=ACCEPTED;X-CALENDARSERVER-DTSTAMP=20170629T173339Z;CN=jag:/aNDM3NzY5NTU0Mzc3Njk1NYeGQfswrR4swF97f86hXgEy6_Ht3psyYKknwa5ed2iV/principal/
UID:4CF18F94-CFB0-4EC8-8CA3-13BD88BE3009
DTSTART;TZID=America/Los_Angeles:20170530T183000
DTEND;TZID=America/Los_Angeles:20170530T220000
RRULE:FREQ=WEEKLY
EXDATE;TZID=America/Los_Angeles:20170711T183000
EXDATE;TZID=America/Los_Angeles:20170627T183000
EXDATE;TZID=America/Los_Angeles:20170620T183000
END:VEVENT
BEGIN:VEVENT
SUMMARY:Test
TRANSP:OPAQUE
ATTENDEE;CUTYPE=INDIVIDUAL;EMAIL=a#icloud.com;PARTSTAT=ACCEPTED;
ROLE=CHAIR;CN=a: /aMzg2Mzc2MTQzODYzNzYxNBljuJkfI_9Sr7UoBKqc9uB4hzRY_BLyjaYyqorZZI2N/principal/
ATTENDEE;CUTYPE=INDIVIDUAL;EMAIL=jag#icloud.com;
PARTSTAT=DECLINED;X-CALENDARSERVER-DTSTAMP=20170629T173339Z;
CN=jag:/aNDM3NzY5NTU0Mzc3Njk1NYeGQfswrR4swF97f86hXgEy6_Ht3psyYKknwa5ed2iV/principal/
UID:4CF18F94-CFB0-4EC8-8CA3-13BD88BE3009
DTSTART;TZID=America/Los_Angeles:20170606T183000
DTEND;TZID=America/Los_Angeles:20170606T220000
RECURRENCE-ID;TZID=America/Los_Angeles:20170606T183000
END:VEVENT
END:VCALENDAR
Here, I have weekly recurring meeting for every Tuesday from 6:30 PM to 10:00 PM. I have deleted the single occurrence for 06/06/2017. But when I fetch meetings it gives deleted occurrence i.e 06/06/2017 6:30 PM to 10:30 PM which it shouldn't be. While 20/06, 27/06 and 11/07 comes in ex date which is fine. My question is that why 06/06 is not in ex date even after deletion like other deleted dates ?
Thanks in advance

Related

RRule for semi-weekly events

I've been trying to figure out how to compose an RRULE that has events on alternating days each week; for example:
Week A: Monday at 4pm
Week B: Friday at 4pm
Where Week A and Week B alternate continuously into the future.
The closest I've gotten is this:
RRULE:FREQ=WEEKLY;COUNT=30;INTERVAL=2;BYDAY=MO,FR
which is close, but gives me the monday and friday on the same week. How can I code it to select the second friday in the two-week interval? This seems much less complex than much of what can be done with RRULEs, so I'm likely missing something obvious?
If this is intended to go on forever, with no 'COUNT', then I think the only way you can do it is to have two events.
Using any other of the BY's even BYSETPOS gets one into trouble at some point at the end of the year, or the end of the sequence as far as you defined it. Two events allows one to iterate the Monday and the Friday cleanly.
The choice of DTSTART for each event is crucial to be sure that you are recurring the right Fridays after the Mondays. You have something like M fm FM fm FM fm
From
https://calendar.google.com/calendar/ical/eppua87dpfnq85bsrrt2siqlcs%40group.calendar.google.com/public/basic.ics
BEGIN:VEVENT
DTSTART:20211022T160000Z
DTEND:20211022T170000Z
RRULE:FREQ=WEEKLY;WKST=MO;INTERVAL=2;BYDAY=FR
DTSTAMP:20211012T064353Z
UID:STACKTESTFRIDAY
CREATED:20171102T185254Z
DESCRIPTION:
LAST-MODIFIED:20211012T064141Z
LOCATION:
SEQUENCE:2
STATUS:CONFIRMED
SUMMARY:Afternoon Tea on Friday
TRANSP:OPAQUE
END:VEVENT
BEGIN:VEVENT
DTSTART:20211011T160000Z
DTEND:20211011T180000Z
RRULE:FREQ=WEEKLY;WKST=MO;INTERVAL=2;BYDAY=MO
DTSTAMP:20211012T064353Z
UID:STACKTESTMONDAY
CREATED:20171102T185254Z
DESCRIPTION:
LAST-MODIFIED:20211012T064112Z
LOCATION:
SEQUENCE:2
STATUS:CONFIRMED
SUMMARY:Afternoon Tea on Monday
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
Here another option that might work for you. In a YEARLY rule you can prepend the BYDAY elements with an offset n to identify the n-th instance of that weekday in the year.
If your recurring event starts on the 20th Monday of the year you could build a rule like this to iterate 30 instances with alternating weekdays.
RRULE:FREQ=YEARLY;BYDAY=20MO,21FR,22MO,23FR,24MO,25FR,26MO,27FR,28MO,29FR,30MO,31FR,32MO,33FR,34MO,35FR,36MO,37FR,38MO,39FR,40MO,41FR,42MO,43FR,44MO,45FR,46MO,47FR,48MO,49FR
Note, this assumes the year starts on a Saturday, Sunday or Monday.
If the year starts on a Tuesday, Wednesday, Thursday or Friday, the weekdays have to have the same number (because in that case the n-th Monday and the n+1-th Friday occur in the same week), i.e.
RRULE:FREQ=YEARLY;BYDAY=20MO,22FR,22MO,24FR,24MO,26FR,26MO,28FR,28MO,30FR,30MO,32FR,32MO,34FR,34MO,36FR,36MO,38FR,38MO,40FR,40MO,42FR,42MO,44FR,44MO,46FR,46MO,48FR,48MO,50FR

iCalendar timezone definition for DST period

By definition European Summer Time begins at last Sunday of March and ends by last Sunday of October
see: https://en.wikipedia.org/wiki/Summer_Time_in_Europe
iCalendar event generated from thunderbird's lightning calendar use this definition of timezone with timestamps from year 1970
BEGIN:VTIMEZONE
TZID:Europe/Prague
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
Since last Sunday of March and October probably won't be the same day every year, shouldn't there be different date every year?
For example for 2016:
BEGIN:VTIMEZONE
TZID:Europe/Prague
BEGIN:DAYLIGHT
...
DTSTART:20160327T020000
...
END:DAYLIGHT
BEGIN:STANDARD
...
DTSTART:20161030T030000
...
END:STANDARD
END:VTIMEZONE
Is it right or am I missing something?
The DTSTART indicates the start date, but after that RRULE is used to calculate all the next occurences.
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
This means:
Recur every year
On every 3rd month
On the last sunday of that month

.ical standard format for Outlook and Google Calendar?

BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 10.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
TZID:Eastern Time Zone
SUMMARY:Mount view
DTSTART:20150310T01:00:00Z
LOCATION:CHRIS NISWANDEE BITBOOST TUCSON Alabama 85728
SEQUENCE:0
DESCRIPTION:Spring is one of the four conventional temperate seasons, following winter and preceding summer. There are various technical definitions of spring, but local usage of the term varies according to local climate, cultures and customs.
END:VEVENT
BEGIN:VEVENT
TZID:Eastern Time Zone
SUMMARY:Mount view
DTSTART:20150310T01:00:00Z
LOCATION:CHRIS NISWANDEE BITBOOST TUCSON Alabama 85728
SEQUENCE:0
DESCRIPTION:Spring is one of the four conventional temperate seasons, following winter and preceding summer. There are various technical definitions of spring, but local usage of the term varies according to local climate, cultures and customs.
END:VEVENT
BEGIN:VEVENT
TZID:Eastern Time Zone
SUMMARY:Reiver view
DTSTART:20150311T13:25:59Z
LOCATION:100 MAIN ST PO BOX 1022 SEATTLE Hawaii 98104
SEQUENCE:0
DESCRIPTION:Spring is one of the four conventional temperate seasons, following winter and preceding summer. There are various technical definitions of spring, but local usage of the term varies according to local climate, cultures and customs.
END:VEVENT
BEGIN:VEVENT
TZID:Eastern Time Zone
SUMMARY:Reiver view
DTSTART:20150312T11:30:26Z
LOCATION:The Honorable Charles W. Anderson (Dear Mr. Ambassador:) 2050 Bamako Place DC Washington 20521-2050
SEQUENCE:0
DESCRIPTION:Spring is one of the four conventional temperate seasons, following winter and preceding summer. There are various technical definitions of spring, but local usage of the term varies according to local climate, cultures and customs.
END:VEVENT
BEGIN:VEVENT
TZID:Eastern Time Zone
SUMMARY:Site seeing
DTSTART:20150312T15:50:23Z
LOCATION:The Honorable Charles W. Anderson (Dear Mr. Ambassador:) 2050 Bamako Place DC Washington 20521-2050
SEQUENCE:0
DESCRIPTION:Spring is one of the four conventional temperate seasons, following winter and preceding summer. There are various technical definitions of spring, but local usage of the term varies according to local climate, cultures and customs.
END:VEVENT
BEGIN:VEVENT
TZID:Eastern Time Zone
SUMMARY:Breakfast
DTSTART:20150315T23:55:13Z
LOCATION:1500 N Congress Ave #3E18 Austin Texas 78701
SEQUENCE:0
DESCRIPTION:Spring is one of the four conventional temperate seasons, following winter and preceding summer. There are various technical definitions of spring, but local usage of the term varies according to local climate, cultures and customs.
END:VEVENT
END:VCALENDAR
The above .ics file is workign fine on Outlook, but when I import to Google Calendar, the event start time shows an incorrect value.
What is missing from the above .ics file?
Can anyone provide a standard .ics file format with a clear example?
Thank you.
The DTSTART format should look like
DTSTART:20150310T010000Z
Then, for each event, you have a TZID property which is illegal within a VEVENT.
But are your DTSTART expressed in zulu (utc) time or in some local timezone ?

Appointment in calendars use wrong time from ics file

I am generating a .ics file. When I import it to a calendar app (such as the on on OSX or iOS) it says:
20:00 to 21:00
18:00 to 19:00 (GMT)
But I need to have the time of the appointment to be 18:00 to 19:00 by default (GMT time). How can I do it?
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:xxx
X-WR-TIMEZONE:Europe/Zurich
X-WR-CALDESC:
BEGIN:VTIMEZONE
TZID:Europe/Zurich
X-LIC-LOCATION:Europe/Zurich
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
Event:
BEGIN:VEVENT
DTSTART:20140929T180000Z
DTEND:20140929T190000Z
DTSTAMP:20141001T223333Z
UID:542c651df4095
DESCRIPTION:Keine
SUMMARY:Mindblowers
LOCATION:
URL;VALUE=URI:xxx
END:VEVENT
most calendar applications will display in the timezone that you have set in the app. So to see times in GMT time, set the timezone of the app to GMT.
Alternatively you may not really be meaning that you want 18:00 to 19:00 (GMT) but that you want 18:00 to 19:00 no matter what timezone the app is in. This is called a 'floating time' (like an alarm that wakes you at 7am no matter what city or timezone you are in, no at 7am back home).
https://www.rfc-editor.org/rfc/rfc5545#page-32
For example, the following represents January 18, 1998, at
11 PM:
19980118T230000
DATE-TIME values of this type are said to be "floating" and are
not bound to any time zone in particular. They are used to
represent the same hour, minute, and second value regardless of
which time zone is currently being observed.

How do I make an iCal feed for holidays moved to adjacent weekdays?

I'm trying to make an iCal feed (RFC 2445) for work holidays that won't need yearly updates, by listing holidays per their definition, rather than which dates they occur on on particular years.
Holidays like Memorial day (last Monday in May) of course don't need any special treatment beyond
BEGIN:VEVENT
DTSTAMP:20130210T211949Z
UID:20130210-memorial-day#usa.gov
DTSTART;VALUE=DATE:20130527
DTEND;VALUE=DATE:20130527
SUMMARY:Memorial Day
RRULE:FREQ=YEARLY;BYMONTH=5;BYDAY=-1MO;WKST=SU
END:VEVENT
...but when it comes to date-based holidays like New Year's Day, how does one encode the day slip on weekend Jan 1sts?
you should be aware that even though google calendar follows RFC2445, it has been obsoleted by RFC5545 which has made the EXRULE obsolete (deprecated features from RFC2445).
in the case of UK new year, it is:
BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
PRODID:pyICSParser
BEGIN:VEVENT
DTSTART;VALUE=DATE:20070101
RRULE:FREQ=YEARLY;BYMONTH=1;BYDAY=MO,TU,WE,TH,FR;BYMONTHDAY=1,2,3;BYSETPOS=1
UID:UIDnewyear_SO14805248#stackeroverflow.com
DTSTAMP:19970714T170000Z
SUMMARY: new year
END:VEVENT
END:VCALENDAR
which works like a charm under google calendar, outlook.com(/hotmail/...), yahoo calendars and on iOS devices synching from a Google Calendar.
UPDATE: for the USA new year
it would be a combination of 2 RRULE (RFC says SHOULD NOT occur more than once which seems to leave the possibility of 2 RRULE by event:
RRULE:FREQ=YEARLY;BYMONTH=1;BYDAY=MO,TU,WE,TH,FR;BYMONTHDAY=1,2;BYSETPOS=1
RRULE:FREQ=YEARLY;BYMONTH=12;BYDAY=FR;BYMONTHDAY=-1
Google Calendar supports it but looks like yahoo and hotmail/outlook.com don't, so 2 events would need to be created (one with each RRULE). If needed the use of RELATED-TO property could help keep track of their relations.
NOTE: The following answer demonstrates how to do it with a deprecated RFC! I am leaving it for reference, in case anyone ever needs to. See the proper answer for more useful facts!
You can do this by adding corresponding yearly repeating adjacent-Friday and adjacent-Monday rules that only show up years where the date has the corresponding weekday:
BEGIN:VEVENT
DTSTAMP:20130210T211949Z
UID:20130210-new-years-day-less-1#usa.gov
DTSTART;VALUE=DATE:20121231
DTEND;VALUE=DATE:20121231
SUMMARY:New Year’s Day (moved from a Saturday)
RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=31
EXRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=31;BYDAY=MO,TU,WE,TH,SA,SU
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20130210T211949Z
UID:20130210-new-years-day-plus-1#usa.gov
DTSTART;VALUE=DATE:20130102
DTEND;VALUE=DATE:20130102
SUMMARY:New Year’s Day (moved from a Sunday)
RRULE:FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=2
EXRULE:FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=2;BYDAY=TU,WE,TH,FR,SA,SU
END:VEVENT
Together with the original event (you can similarly filter this one for BYDAY=MO,TU,WE,TH,FR if you don't want the actual holiday to show up in your feed), you cover all years without getting false positives on years where there was no need to move the time off to a weekday:
BEGIN:VEVENT
DTSTAMP:20130210T211949Z
UID:20130210-new-years-day#usa.gov
DTSTART;VALUE=DATE:20130101
DTEND;VALUE=DATE:20130101
SUMMARY:New Year’s Day
RRULE:FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1
END:VEVENT
Google Calendar happily consumes and understands my example iCalendar feed. Current iCal (and iOS devices synced from a Google Calendar that imported this feed) unfortunately are a little buggy (filed as  bug 13188350 [link probably only works for the reporter]), and fail to apply the specified weekday filters.
But hopefully that gets fixed too, some time soon.