getCalendar (Get calendar of a date field)

Reads the calendar of a Date/Time element and returns it as a copy

If the field with the specified element ID does not exist, is not a date field or has no calendar stored, an empty result ($null) is returned.

►NOTE◄ If this function is called before the source field's calendar has been fully loaded, it will NOT wait for the calendar to be initialized. In this case the currently loaded calendar of the field will be returned.

Syntax

$getCalendar(elementId)

Parameter

Name

Description

elementId

The ID of the Date/Time element

Return value

An object of the 'calendar' type or $null if there is no calendar or the specified field is not a Date/Time element.

Example

Syntax

Result

$getCalendar( 5 )

The calendar copy of the date field with the element ID 5