Skip to content

Instantly share code, notes, and snippets.

@ayoisaiah
Last active May 31, 2025 09:25
Show Gist options
  • Save ayoisaiah/95678732d4f972b33b448ce7144dc282 to your computer and use it in GitHub Desktop.
Save ayoisaiah/95678732d4f972b33b448ce7144dc282 to your computer and use it in GitHub Desktop.
G
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