@@ -66,7 +66,7 @@ function escapeIcs(str: string): string {
6666 . replace ( / \n / g, '\\n' ) ;
6767}
6868
69- export function calendarLinks ( node : Node ) : { googleCalUrl : string ; icsContent : string } {
69+ export function calendarLinks ( node : Node ) : { googleCalUrl : string ; outlookCalUrl : string ; icsContent : string } {
7070 const startDate = toICalDate ( node . event_date ?? '' ) ;
7171 const endDate = node . event_end_date ? toICalDate ( node . event_end_date ) : nextDay ( node . event_date ?? '' ) ;
7272 const location = node . location_tbd
@@ -83,6 +83,16 @@ export function calendarLinks(node: Node): { googleCalUrl: string; icsContent: s
8383 } ) ;
8484 const googleCalUrl = `https://calendar.google.com/calendar/render?${ params . toString ( ) } ` ;
8585
86+ // Outlook Web Calendar URL
87+ const outlookParams = new URLSearchParams ( {
88+ subject : node . event_name ,
89+ startdt : node . event_date ?? '' ,
90+ enddt : node . event_end_date ?? node . event_date ?? '' ,
91+ body : node . details_text || node . event_short_description ,
92+ location,
93+ } ) ;
94+ const outlookCalUrl = `https://outlook.live.com/calendar/0/action/compose?${ outlookParams . toString ( ) } ` ;
95+
8696 // ICS content
8797 const now = new Date ( ) ;
8898 const dtstamp = now . toISOString ( ) . replace ( / [ - : ] / g, '' ) . split ( '.' ) [ 0 ] + 'Z' ;
@@ -109,7 +119,7 @@ export function calendarLinks(node: Node): { googleCalUrl: string; icsContent: s
109119 'END:VCALENDAR' ,
110120 ] . join ( '\r\n' ) ;
111121
112- return { googleCalUrl, icsContent } ;
122+ return { googleCalUrl, outlookCalUrl , icsContent } ;
113123}
114124
115125export function formatShortDate ( dateStr : string ) : string {
0 commit comments