API Reference
ICSParser
API reference for the ICSParser class.
import { ICSParser } from '@forcecalendar/core';Constructor
new ICSParser()Methods
| Method | Signature | Returns |
|---|---|---|
parse | (icsString: string) => EventData[] | Array of event objects |
export | (events: EventData[], calendarName?: string) => string | ICS string |
parse() Output
Each event object contains:
| Property | Source ICS Property |
|---|---|
title | SUMMARY |
start | DTSTART |
end | DTEND |
description | DESCRIPTION |
location | LOCATION |
recurrenceRule | RRULE |
status | STATUS |
uid | UID |
organizer | ORGANIZER |
attendees | ATTENDEE |
categories | CATEGORIES |
reminders | VALARM |
allDay | Detected from date-only DTSTART |
export() Output
Produces a valid RFC 5545 ICS string with:
BEGIN:VCALENDAR/END:VCALENDARwrapperVERSION:2.0PRODIDidentifierVEVENTblocks for each eventVALARMblocks for reminders- Text escaping (commas, semicolons, newlines)
- Line folding at 75 octets