ICalUtilSNC - Global

The ICalUtilSNC script include provides functions to generate iCalendar compliant events.

ICalUtilSNC - formatICalComponent(Array arrEvents)

Generates a formatted VCALENDAR component.

表 : 1. Parameters
Name Type Description
arrEvents Array Properties that make up a VCALENDAR component.
表 : 2. Returns
Type Description
Array Properties needed to form a VCALENDAR.

ICalUtilSNC - formatICalEvent(Array arrEvent, Boolean useAlarm)

Generates a formatted VEVENT.

表 : 3. Parameters
Name Type Description
arrEvent Array Contains the individual properties that make up a VEVENT.
useAlarm Boolean If true, adds a VALARM to the VEVENT.
表 : 4. Returns
Type Description
String The formatted VEVENT.

ICalUtilSNC - formatRecurringRule (Object ruleObj)

Formats the RRULE property for a VEVENT.

表 : 5. Parameters
Name Type Description
ruleObj Object Contains the properties for the RRULE property.
表 : 6. Returns
Type Description
String The formatted RRULE property.

ICalUtilSNC - getDateFromScheduleDateTime (GlideScheduleDateTime scheduleDateTime)

Returns the date from the GlideScheduleDateTime.

表 : 7. Parameters
Name Type Description
scheduleDateTime GlideScheduleDateTime A GlideScheduleDateTime representation of the date and time.
表 : 8. Returns
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)

Returns a GlideScheduleDateTime object based on the passed date and time string.

表 : 9. Parameters
Name Type Description
sdtStr String Formatted ScheduleDateTime.
timeZone String Optional. Time zone to use when generating the GlideScheduleDateTime object.
表 : 10. Returns
Type Description
GlideScheduleDateTime A GlideScheduleDateTime representation of the passed date and time string.

ICalUtilSNC - getTimeFromScheduleDateTime (GlideScheduleDateTime scheduleDateTime)

Returns the time from the GlideScheduleDateTime.

表 : 11. Parameters
Name Type Description
scheduleDateTime GlideScheduleDateTime A GlideScheduleDateTime representation of the date and time.
表 : 12. Returns
Type Description
String Formatted time.

The following code example shows how to call this method.

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