CalendarIntervalModel

This is a documentation-only class, representing an interval in the calendar

Please refer to the calendars guide for details

Properties

62

Class hierarchy

isCalendarIntervalModel: Boolean= truereadonly
Identifies an object as an instance of CalendarIntervalModel class, or subclass thereof.
isCalendarIntervalModel: Boolean= truereadonlystatic
Identifies an object as an instance of CalendarIntervalModel class, or subclass thereof.
isModelModel
isModelLinkModelLink
isModelStmModelStm
isTreeNodeTreeNode

Editing

copyOfModel
isValidModel

Fields

allFieldsstaticModel
autoExposeFieldsstaticModel
childrenFieldstaticModel
defaultsstaticModel
fieldMapstaticModel
fieldsstaticModel
idFieldstaticModel

Grouping

Identification

keyModel

JSON

jsonModel

Lifecycle

configBase

Linked records

hasLinksModelLink
isLinkedModelLink
recordLinksModelLink

Misc

stmModelStm

Other

$namestaticModel
relationsstaticModel

Parent & children

allChildrenTreeNode
childLevelTreeNode
firstChildTreeNode
isLeafTreeNode
isLoadedTreeNode
isParentTreeNode
isRootTreeNode
lastChildTreeNode
nextSiblingTreeNode
parentTreeNode
parentIdTreeNode

Functions

58

Other

Returns an internal representation of the recurrent end date from the later library.

Returns: Object

Returns an internal representation of the recurrent start date from the later library.

Returns: Object

Whether this interval is recurrent (both recurrentStartDate and recurrentEndDate are present and parsed correctly by the later library).

Returns: Boolean

Whether this interval is static - both startDate and endDate are present.

Returns: Boolean

Configuration

applyDefaultsstaticBase

Editing

copyModel
getDataModel
removeModel
setModel

Events

Fields

addFieldstaticModel
getModel
processFieldstaticModel
removeFieldstaticModel

Identification

asIdstaticModel
generateIdstaticModel

JSON

toJSONModel

Lifecycle

destroystaticBase

Misc

equalsModel
initClassstaticBase
isOfTypeNamestaticBase
linkModelLink
mixinstaticBase

Parent & children

appendChildTreeNode
bubbleTreeNode
bubbleWhileTreeNode
containsTreeNode
insertChildTreeNode
isExpandedTreeNode
removeChildTreeNode
traverseTreeNode

Typedefs

1

Fields

14

Working time for the interval (works if the interval is of Exception type).

cls: String

A CSS class to add to the element visualizing this interval, when using the NonWorkingTime feature.

Note that only non working intervals are visible.
color: String

The interval color (the value is used in the calendar editor popup).

Identifier of the calendar editor interval this record is part of. Sometimes many instances of this class represent a single calendar editor interval and in this case this field have the same value for such group of records.

endDate: Date | String

The end date of the fixed (not recurrent) time interval.

iconCls: String

A CSS class used to add an icon to the element visualizing this interval, when using the NonWorkingTime feature.

Note that only non working intervals are visible.
isWorking: Boolean= false

The "is working" flag, which defines what kind of interval this is - either working or non-working. Default value is false, denoting non-working intervals.

name: String

Interval name.

priority: Number

The priority of the interval. By default, recurrent intervals are assigned the priority 20 and static - priority 30.

This field influences which interval is selected for isWorking value in case of intervals intersection.

Intervals intersection occurs for example in this case:

{
    id        : 1,
    name      : 'My Calendar',
    intervals : [
        {
            recurrentStartDate : 'at 08:00',
            recurrentEndDate   : 'at 16:00',
            isWorking          : true
        },
        {
            recurrentStartDate : 'on Sat at 00:00',
            recurrentEndDate   : 'on Mon at 00:00',
            isWorking          : false
        }
    ],
    unspecifiedTimeIsWorking : false
}

The intention here is to define a calendar with "normal" working time 08:00-16:00 and non-working weekend days. However, the intervals intersects - for weekend days, the timespan 08:00-16:00 presents in both intervals, with the different isWorking flag.

Which interval "wins" in such case of intersection is defined by the following rules:

  • Intervals from the child calendar always wins over the parent's
  • Static intervals wins over the recurrent intervals (in the same calendar)
  • Between the static intervals of the calendar, the one with bigger priority field value wins over the one with smaller priority field value.
  • Between the static intervals of the calendar with the same priority, the one with bigger index wins over the one with smaller index ("last win")
  • Between the recurrent intervals of the calendar, the one with bigger priority field value wins over the one with smaller priority field value
  • Between the recurrent intervals of the calendar with the same priority, the ones with bigger index wins over the ones with smaller index ("last win")
recurrentDatesTimeZone: String | Number

A timezone in which recurrentStartDate and recurrentEndDate rules are specified. If not provided the local machine timezone is used for the dates. Can be provided either as a IANA time zone (i.e. Europe/Stockholm) or a UTC offset in minutes (i.e. -120).

The end date of the recurrent time interval. Should be specified as any expression, recognized by the excellent later library.

Please refer to later documentation for the details about supported parsers.

For simple scenarios, you can use string format. We recommend using later.parse for advanced use cases only.

// occurs at 10:30am every day
recurrentEndDate  : 'at 10:30 am'

// occurs everyday at 14:00 Starting from 28 Feb.
recurrentEndDate  : 'at 14:00 every 1 day of the year starting on the 59'

// For advanced use cases
// occurs the 3rd minute every hour
recurrentEndDate  : later.parse.recur().on(3).minute()

// occurs on the last day of every month at 6am
recurrentEndDate  : later.parse.recur().on(6).hour().last().dayOfMonth();

The field value can be omitted when recurrentStartDate has a recurrence rule provided. In this case the interval will be calculated based on start date schedule only and its end will be calculated as the end of the day found based on the start date schedule.

The start date of the recurrent time interval. Should be specified as any expression, recognized by the excellent later library.

Please refer to later documentation for the details about supported parsers.

For simple scenarios, you can use string format. We recommend using later.parse for advanced use cases only.

// occurs at 10:15am every day
recurrentStartDate  : 'at 10:15 am'

// occurs everyday at 13:00 starting from 28 Feb.
recurrentStartDate  : 'at 13:00 every 1 day of the year starting on the 59'

// For advanced use cases
// occurs the 2nd minute every hour
recurrentStartDate  : later.parse.recur().on(2).minute()

// fires on the last day of every month at 5am
recurrentStartDate  : later.parse.recur().on(5).hour().last().dayOfMonth();
startDate: Date | String

The start date of the fixed (not recurrent) time interval.

Interval type. Specifies which kind the interval is - a week or an exception.