We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84a339a commit 02c6335Copy full SHA for 02c6335
components.go
@@ -413,6 +413,22 @@ func (calendar *Calendar) AddVEvent(e *VEvent) {
413
calendar.Components = append(calendar.Components, e)
414
}
415
416
+func (calendar *Calendar) RemoveEvent(id string) {
417
+ for i := range calendar.Components {
418
+ switch event := calendar.Components[i].(type) {
419
+ case *VEvent:
420
+ if event.Id() == id {
421
+ if len(calendar.Components) > i+1 {
422
+ calendar.Components = append(calendar.Components[:i], calendar.Components[i+1:]...)
423
+ } else {
424
+ calendar.Components = calendar.Components[:i]
425
+ }
426
+ return
427
428
429
430
+}
431
+
432
func (calendar *Calendar) Events() (r []*VEvent) {
433
r = []*VEvent{}
434
for i := range calendar.Components {
0 commit comments