When you need to convert a schedule, study plan, or task list into an iCalendar (.ics) file that can be imported into Google Calendar or any other iCalendar‑compatible client.
- summary (string)
- description (string, optional)
- start (ISO‑8601 date/time or JS Date)
- end (ISO‑8601 date/time or JS Date)
- colorId (Google Calendar colour ID, optional)
- First chunk – supply the intended start date (e.g., 2026‑05‑31T09:00:00Z).
- Subsequent chunks – pass the last date of the previous chunk (via the lastDate field). The skill will automatically shift the next chunk’s start date forward by one day, guaranteeing a clean “one‑day‑gap” between chunks.
run function exported by index.js with the event array and optional lastDate.| Feature | Details |
|---|---|
| --------- | --------- |
| Google‑Calendar compatibility | Automatically injects the required headers:PRODID:-//Google Inc//Google Calendar 70.6//EN CALSCALE:GREGORIAN |
| UTC enforcement | All start/end times are normalized to UTC and formatted as YYYYMMDDTHHMMSSZ. Google Calendar accepts this exact format without further conversion. |
| Unique identifiers | Each event receives a UUID‑v4‑derived UID (event-) so calendar clients can correctly sync updates. |
| Color handling | If a colorId is supplied, it’s added as X‑GOOGLE‑CALENDAR‑COLOR: inside the VEVENT block. |
| Output | Returns a complete .ics string wrapped in BEGIN:VCALENDAR … END:VCALENDAR. Every VEVENT ends with END:VEVENT and the final block ends with END:VCALENDAR. |
| Dependencies | Node ≥ 20 (for crypto.randomUUID()). No external npm packages—pure JavaScript plus Node’s built‑in crypto module. |
| License | MIT – free to copy, modify, and share. |
PRODID / CALSCALE?From community feedback, Google Calendar only imported the generated file when those exact values were present. A generic PRODID caused the “Unable to launch event” error; CALSCALE:GREGORIAN tells Google Calendar which calendar system to assume (Gregorian), which is required for proper time‑zone handling.
共 1 个版本