calendar-links icon indicating copy to clipboard operation
calendar-links copied to clipboard

Reoccurring event support

Open atymic opened this issue 1 year ago • 2 comments

What do you want to achieve?

Allow creating links for reoccurring events. This is possible, on the main paid provider (AddEvent). They however have this feature behind a paywall, so I'm not sure of exactly the link format for all providers. Will try to find a link to test with.

Screen Shot 2024-01-26 at 11 08 04@2x

atymic avatar Jan 26 '24 10:01 atymic

This should work with Google Calendar:

$link->google(['recur' => 'RRULE:FREQ=DAILY']);

Syntax is described by RFC-5545

But I'm not sure about other calendars/services

alies-dev avatar Feb 24 '24 12:02 alies-dev

Today I tried to reverse-engineer outlook code and find recur param in their code, but without luck.

But good news I found few more params from this code:

function l(e, t, n) {
            const l = function(e, t) {
                const n = {};
                e.subject && (n.Subject = r.Z.sanitizeHtml(e.subject)),
                e.body && (n.Body = {
                    BodyType: "HTML",
                    Value: r.Z.sanitizeHtml(e.body)
                });
                const {UserOptions: u} = (0,
                o.c6)()
                  , d = u?.TimeZone;
                if (e.startdt)
                    try {
                        n.Start = (0,
                        a.ri)(d, e.startdt)
                    } catch {}
                if (e.enddt)
                    try {
                        n.End = (0,
                        a.ri)(d, e.enddt)
                    } catch {}
                if (e.allday && (n.IsAllDayEvent = "true" == e.allday.toLowerCase()),
                e.location && (n.Locations = [{
                    Id: e.location,
                    DisplayName: e.location,
                    PostalAddress: {
                        Type: "Business",
                        LocationSource: "None"
                    }
                }]),
                "online"in e && (n.IsOnlineMeeting = !0),
                e.to || e.cc) {
                    const t = e=>e.map((e=>({
                        Mailbox: e
                    })));
                    if (e.to) {
                        const r = [];
                        (0,
                        s.Z)(e.to, r),
                        n.RequiredAttendees = t(r)
                    }
                    if (e.cc) {
                        const r = [];
                        (0,
                        s.Z)(e.cc, r),
                        n.OptionalAttendees = t(r)
                    }
                }
                if (e.folderid && t) {
                    const r = {
                        Id: e.folderid,
                        mailboxInfo: t
                    };
                    n.ParentFolderId = r
                }
                return e.reqresponse && (n.IsResponseRequested = "true" == e.reqresponse.toLowerCase()),
                e.allowfw && (n.DoNotForwardMeeting = "true" != e.allowfw.toLowerCase()),
                e.hideattn && (n.HideAttendees = "true" == e.hideattn.toLowerCase()),
                e[i] && (n.ReminderMinutesBeforeStart = Number(r.Z.sanitizeHtml(e[i]))),
                e.freebusy && (n.FreeBusyType = function(e) {
                    switch (e.toLowerCase()) {
                    case "free":
                        return "Free";
                    case "tentative":
                    default:
                        return "Tentative";
                    case "busy":
                        return "Busy";
                    case "oof":
                        return "OOF";
                    case "workingelsewhere":
                        return "WorkingElsewhere";
                    case "nodata":
                        return "NoData"
                    }
                }(r.Z.sanitizeHtml(e.freebusy))),
                n
            }(e, t)
              , c = `${(0,
            u.P)()}${location.pathname}`;
            window.history.replaceState(null, "", c),
            d.oA.importAndExecute({
                fullComposeEntrySource: "Deeplink_Compose",
                viewType: n,
                eventUpdates: l,
                shouldRespectStartEndTime: !!l.Start || !!l.End
            })
        }

And updated docs: https://github.com/InteractionDesignFoundation/add-event-to-calendar-docs/commit/30452622bce7eccfa25728565882977aa4630860

alies-dev avatar Feb 24 '24 14:02 alies-dev

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.

spatie-bot avatar Jun 25 '24 10:06 spatie-bot