API Docs for: 1.0.0
Show:

CWTCalendarUtil Class

Utility for working with the Portal Calendar class.

Constructor

CWTCalendarUtil

(
  • calendar
)

Parameters:

Item Index

Methods

Methods

convert

(
  • record
)
Object static

Convert a GlideRecord to a standard Javascript object

Parameters:

  • record GlideRecord

    The record to convert to a standard Javascript object

Returns:

Object:

The records values as an independent object.

getCalendarJSON

() Object

Get the key values of the current calendar for managing displaying information regarding it.

Returns:

Object:

Describes the minimal details of the current calendar to avoid disclosing unneeded private information such as the owner.

getEvents

(
  • [published]
  • [featured]
  • [lower]
  • [upper]
)
Array

Get the events associated with the current calendar (See: this.calendar).

Parameters:

  • [published] Boolean optional

    When true, only published events are retrieved.

  • [featured] Boolean optional

    When true, only featured events are retrieved.

  • [lower] GlideDate optional

    When specified, used as the minimum time for the starting date of an event.

  • [upper] GlideDate optional

    When specified, used as the maximum time for the starting date of an event.

Returns:

Array:

Array of JSON objects describing the events currently associated with the current calendar sorted by begin date.

hasAccess

()

Check if the current user has access to the currently declared calendar.

isFalse

(
  • value
)
Boolean private static

Determine if a value should be considered true.

Due to a variety of ways of true/false values being returned by service now, this method exists to level set to a JavaScript boolean value for use.

Parameters:

Returns:

Boolean:

True if the value is considered as trying to be "true", false otherwise.

isFalse

(
  • value
)
Boolean private static

Determine if a value should be considered false.

Due to a variety of ways of true/false values being returned by service now, this method exists to level set to a JavaScript boolean value for use.

Parameters:

Returns:

Boolean:

True if the value is considered as trying to be "false", false otherwise.

Properties

calendar

GlideRecord | PortalCalendar

The PortalCalendar that this utility is currently associated with for pulling values and performing checks.

toJSONKeys

Object private

Values for a calendar to cast it to JSON.

Limited values for privacy concerns.

toJSONMap

Object private

Values for a calendar to cast it to JSON.

Limited values for privacy concerns.