### Generate Calendar Links (JavaScript) Source: https://anandchowdhary.github.io/calendar-link/index This snippet demonstrates how to import and use the calendar-link library in JavaScript to generate event links for various calendar services including Google Calendar, Outlook, Office 365, Yahoo Calendar, and ICS files. It shows how to define an event object with details like title, description, start time, and duration, and then use the library's functions to create the respective calendar links. ```javascript // Usage with Node.js const { google, outlook, office365, yahoo, ics } = require("calendar-link"); // Usage with TypeScript or ES6 import { google, outlook, office365, yahoo, ics } from "calendar-link"; // Set event as an object const event = { uid: "your-unqiue-id", title: "My birthday party", description: "Be there!", start: "2019-12-29 18:00:00 +0100", duration: [3, "hour"], }; // Then fetch the link google(event); // https://calendar.google.com/calendar/render... outlook(event); // https://outlook.live.com/owa/... office365(event); // https://outlook.office.com/owa/... yahoo(event); // https://calendar.yahoo.com/?v=60&title=... ics(event); // standard ICS file based on https://icalendar.org ``` -------------------------------- ### Calendar Link Generation Source: https://anandchowdhary.github.io/calendar-link/index Generates calendar event links for multiple services including Google Calendar, Outlook, Office 365, Yahoo Calendar, and ICS files. ```APIDOC ## Calendar Link Generation API ### Description This API provides functions to generate event links compatible with popular calendar services. You can create links for Google Calendar, Outlook, Office 365, Yahoo Calendar, and standard ICS files. ### Usage ```javascript // Import the library (Node.js) const { google, outlook, office365, yahoo, ics } = require("calendar-link"); // Or import (TypeScript/ES6) import { google, outlook, office365, yahoo, ics } from "calendar-link"; // Define an event object const event = { title: "My birthday party", description: "Be there!", start: "2019-12-29 18:00:00 +0100", duration: [3, "hour"], guests: ["guest1@example.com", "guest2@example.com"], location: "My House", allDay: false, rRule: "FREQ=WEEKLY;COUNT=2", uid: "unique-event-id", url: "https://example.com/event-details" }; // Generate links const googleLink = google(event); const outlookLink = outlook(event); const office365Link = office365(event); const yahooLink = yahoo(event); const icsLink = ics(event); console.log("Google Calendar Link:", googleLink); console.log("Outlook Calendar Link:", outlookLink); console.log("Office 365 Calendar Link:", office365Link); console.log("Yahoo Calendar Link:", yahooLink); console.log("ICS File Link:", icsLink); ``` ### Event Object Options | Property | Description | Allowed values | |---------------|--------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------| | `title` | **Required**. The title of the event. | String | | `start` | **Required**. The start time of the event. | JS Date, ISO 8601 string, or Unix Timestamp | | `end` | The end time of the event. (Mutually exclusive with `duration` and `allDay`) | JS Date, ISO 8601 string, or Unix Timestamp | | `duration` | The duration of the event. (Mutually exclusive with `end` and `allDay`). | Array: `[value (Number), unit (String)]` | | `allDay` | Indicates if the event is an all-day event. (Mutually exclusive with `end` and `duration`) | Boolean | | `rRule` | A recurring event rule string (iCal format). Supported by `google` and `ics`. | iCal recurrence rule string | | `description` | Additional information or details about the event. | String | | `location` | The physical location of the event. | String | | `busy` | Marks the event as busy on the calendar. | Boolean | | `guests` | An array of email addresses for event guests. Supported by `google`, `outlook`, `outlookMobile`, `office365`, `office365Mobile`, and `msTeams`. | Array of Strings (email addresses) | | `url` | A URL related to the event. Defaults to `document.URL` if available. | String | | `uid` | A unique identifier for the event. | String | ### Notes * At least one of `end`, `duration`, or `allDay` must be provided. * The `url` field is useful for server-side rendering where `document.URL` is not available. * Support for `guests` and `url` may vary across different calendar clients. * It is recommended to use UTC for dates and times to ensure consistent behavior across different calendar services. * Office 365 may have inconsistencies in link generation across devices. * The `uid` field is optional but recommended for event identification and deduplication. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.