如何以编程方式使用ical从重复集中删除单个事件? [英] How to delete a single event from a recurring set using ical programmatically?
问题描述
我在10,11th创建了一个周期性的ic事件,请参阅下面,我想删除第10个事件,所以我使用了Method:取消,但是由于UID相同,所以两条记录都将被删除.如何只删除一条记录,我应该使用其他值(例如UID)吗?
I have created a recurring ical event, on 10,11th Please see below, and I want to delete 10th event so I used MEthod: Cancel, but as the UID is same both the records are getting deleted. How to delete only one record, should I use any other value like UID?
BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 9.0 MIMEDIR//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
DTSTART:20150910T100000
DTSTAMP:20150910T115449Z
RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20150911T110000
UID:78163local
Location: Test
DESCRIPTION:test
LAST-MODIFIED:20150910T115449Z
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:service
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
取消事件代码:
BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 9.0 MIMEDIR//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:CANCEL
BEGIN:VEVENT
DTSTART:20150910T100000
DTEND:20150911T110000
DTSTAMP:20150910T115714Z
UID:78163local
Location: Test
DESCRIPTION:Test
LAST-MODIFIED:20150910T115714Z
SEQUENCE:1
STATUS:CANCELLED
SUMMARY:service
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
推荐答案
如果只想删除一个实例,则需要指定要删除的实例的RECURRENCE-ID.
If you want to delete only one instance, you need to specify the RECURRENCE-ID of the instance that you want to delete.
该实例的RECURRENCE-ID对应于该实例的原始DTSTART.因此,在您的情况下,您的取消操作应类似于:
The RECURRENCE-ID of the instance corresponds to the original DTSTART of that instance. So in your case, your cancel should have something like:
DTSTART:20150910T100000
RECURRENCE-ID:20150910T100000
另请参见 http://tools.ietf.org/html/rfc5546#第4.4.3节
这篇关于如何以编程方式使用ical从重复集中删除单个事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!