Last active
May 31, 2025 09:25
-
-
Save ayoisaiah/95678732d4f972b33b448ce7144dc282 to your computer and use it in GitHub Desktop.
G
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createGoogleCalendarUrl(eventDetails) { | |
const googleCalendarUrl = new URL( | |
"https://calendar.google.com/calendar/u/0/r/eventedit", | |
); | |
const params = googleCalendarUrl.searchParams; | |
if (eventDetails.title) { | |
params.append("text", eventDetails.title); | |
} | |
if (eventDetails.dates) { | |
params.append("dates", eventDetails.dates); | |
} | |
if (eventDetails.description) { | |
params.append("details", eventDetails.description); | |
} | |
if (eventDetails.location) { | |
params.append("location", eventDetails.location); | |
} | |
return googleCalendarUrl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment