Menu

One calendar URL, five subscribe links, and the Outlook one Microsoft has never documented
📰

One calendar URL, five subscribe links, and the Outlook one Microsoft has never documented

DEV Community: typescript·Daniel Pertu·about 8 hours ago
#qrDAZS2b
#devtotypescript#devto#dev#calendar#outlook
Reading 0:00
15s threshold

CogniPrep tracks application deadlines, and a deadline is only useful in the calendar the candidate actually looks at. We publish one ICS feed per account. The hard part was never generating the file. It was the handoff: getting a URL into Apple Calendar, Google Calendar and Outlook, each of which wants something different.

The whole handoff is 47 lines with no imports.

Five strings from one

export function calendarSubscriptionLinks ( feedUrl : string ) : CalendarSubscriptionLinks { const webcal = feedUrl . replace ( /^ https ?: \ / \ //, 'webcal://'); return { url : feedUrl , webcal , google : `https://calendar.google.com/calendar/render?cid=${encodeURIComponent(webcal)}` , outlook : outlookAddFromWeb ( 'outlook.live.com' , webcal ) , office365 : outlookAddFromWeb ( 'outlook.office.com' , webcal ) , } ; }

Enter fullscreen mode

Exit fullscreen mode

That is the entire module's logic.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.