logseq-plugin-agenda icon indicating copy to clipboard operation
logseq-plugin-agenda copied to clipboard

Feature request: Allow for recurring events import

Open lsdjr72 opened this issue 2 years ago • 5 comments

Until this plug-in can allow recurring events to be imported from external calendars, it's not going to be useful for me. I can't spend my time comparing two calendars (agenda and Google). But if all repeating events could be imported into Agenda, then I would use it exclusively because of the ability to schedule tasks from projects.

lsdjr72 avatar Apr 10 '23 16:04 lsdjr72

Seconding this issue. Unfortunately, the lack of repeated events in calendar subscriptions is a severe limitation.

How difficult would be adding this feature? I would be happy to help contribute to this feature. Looking at the current code, agenda is not using ical model layer but using the package only to parse calendar's contents. However, ical can generate all occurrences from rrule, as long as we use the package's component layer.

For example, this code using ical.js generates the first 5 occurrences of the scheduled event. We could integrate this with existing functionality to add these to the array of events. Are there other major issues that might prevent us from using recurring events?

let component = new ical.Component(ical.parse(calendar_data));
const vevents = component.getAllSubcomponents('vevent').map((c) => {

  vevent = new ical.Event(c);
  const iterator = vevent.iterator();
  let next;
  let num = 0;
  while ((next = iterator.next()) && num++ < 5) {
     console.log(String(vevent.summary))
     console.log(vevent.getOccurrenceDetails(next).startDate.toICALString());
  }

});

mcopik avatar Jul 27 '23 01:07 mcopik

I mainly focus on how to record recurring events in logseq, and how to make it compatible with todoist and the build-in solutions of logseq.

The code you mentioned here is for supporting recurring events in calendar subscription. There shouldn't be any problem with it, just need to test the compatibility on several mainstream platforms.

haydenull avatar Jul 28 '23 00:07 haydenull

@haydenull Yes, I interpreted this issue as related to importing recurring events from the external calendar: "recurring events to be imported from external calendars".

I don't have any means of testing with iCloud calendar, but I'm happy to test it against Google Calendar and start a PR later.

mcopik avatar Jul 28 '23 09:07 mcopik

@mcopik That's great! I can test iCloud calendar on my end.

haydenull avatar Jul 29 '23 07:07 haydenull

Currently I can see that recurring events are working fine from google calendar, but not from outlook

AnweshGangula avatar Aug 21 '23 12:08 AnweshGangula