ICalUtilSNC - Global
The ICalUtilSNC API provides functions to generate iCalendar compliant events.
ICalUtilSNC - formatICalComponent(Array arrEvents)
Generates a formatted VCALENDAR component.
| Name | Type | Description |
|---|---|---|
| arrEvents | Array | Contains the properties that make up a VCALENDAR component. |
| Type | Description |
|---|---|
| Array | Contains properties needed to form a VCALENDAR. |
ICalUtilSNC - formatICalEvent(Array arrEvent, Boolean useAlarm)
Generates a formatted VEVENT.
| Name | Type | Description |
|---|---|---|
| arrEvent | Array | Contains the individual properties that make up a VEVENT. |
| useAlarm | Boolean | If true, adds a VALARM to the VEVENT. |
| Type | Description |
|---|---|
| String | The formatted VEVENT. |
ICalUtilSNC - formatRecurringRule (Object ruleObj)
Formats the RRULE property for a VEVENT.
| Name | Type | Description |
|---|---|---|
| ruleObj | Object | Contains the properties for the RRULE property. |
| Type | Description |
|---|---|
| String | The formatted RRULE property. |
ICalUtilSNC - getDateFromScheduleDateTime (GlideScheduleDateTime scheduleDateTime)
Returns the date from the GlideScheduleDateTime.
| Name | Type | Description |
|---|---|---|
| scheduleDateTime | GlideScheduleDateTime | A GlideScheduleDateTime representation of the date and time. |
| Type | Description |
|---|---|
| String | Formatted date. |
cURL example
var scheduleDateTime = new GlideScheduleDateTime();
var myICalUtilSNC = new ICalUtilSNC();
var scheduleDate = myICalUtilSNC.getDateFromScheduleDateTime(scheduleDateTime);
gs.info(scheduleDateTime);
gs.info(scheduleDate);
Output:
2023-02-08 09:05:22
20230208
ICalUtilSNC - getSDT(String sdtStr, String timeZone)
If provided with a formatted date time string, it returns a GlideScheduleDateTime object.
| Name | Type | Description |
|---|---|---|
| sdtStr | String | Formatted ScheduleDateTime. |
| timeZone | String | If provided, will be used for the generated GlideScheduleDateTime. |
| Type | Description |
|---|---|
| GlideScheduleDateTime | A GlideScheduleDateTime representation of the sdtStr. |
ICalUtilSNC - getTimeFromScheduleDateTime (GlideScheduleDateTime scheduleDateTime)
Returns the time from the GlideScheduleDateTime.
| Name | Type | Description |
|---|---|---|
| scheduleDateTime | GlideScheduleDateTime | A GlideScheduleDateTime representation of the date and time. |
| Type | Description |
|---|---|
| String | Formatted time. |
cURL example
var scheduleDateTime = new GlideScheduleDateTime();
var myICalUtilSNC = new ICalUtilSNC();
var scheduleDate = myICalUtilSNC.getTimeFromScheduleDateTime(scheduleDateTime);
gs.info(scheduleDateTime);
gs.info(scheduleDate);
Output:
2023-02-08 10:21:43
102143Z