CalendarModel

This class represents a calendar in the Scheduler Pro project. It contains a collection of the CalendarIntervalModel. Every interval can be either recurrent (regularly repeating in time) or static. These intervals can be visualized by the ResourceNonWorkingTime or NonWorkingTime features.

Please refer to the calendars guide for details

Configs

2

Other

adjustDurationToDST: Boolean= false

A flag, indicating whether the duration calculation should adjust the result to DST time shift. By default, this flag is ignored and the corresponding flag from the ProjectModel is used.

However, if you are using the calendar instance independently of the project, this flag might come in handy.

Models & Stores

taskStorePartOfProject

Properties

71

Class hierarchy

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

Other

Intervals store of the calendar created from the intervals field.

$namestaticModel
projectPartOfProject
relationsstaticModel

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

Models & Stores

assignmentStorePartOfProject
dependencyStorePartOfProject
eventStorePartOfProject
resourceStorePartOfProject
taskStorePartOfProject

Parent & children

allChildrenTreeNode
childLevelTreeNode
firstChildTreeNode
isLeafTreeNode
isLoadedTreeNode
isParentTreeNode
isRootTreeNode
lastChildTreeNode
nextSiblingTreeNode
parentTreeNode
parentIdTreeNode

Functions

64

Other

This method adds a single CalendarIntervalModel to the internal collection of the calendar

ParameterTypeDescription
intervalCalendarIntervalModel | CalendarIntervalModelConfig

record or an object with data used to create a new record

Returns: CalendarIntervalModel[] -

Added intervals

This method adds an array of CalendarIntervalModel to the internal collection of the calendar

ParameterTypeDescription
intervalsCalendarIntervalModel[] | CalendarIntervalModelConfig[]

An array of records or an array of objects with data used to create new records

Returns: CalendarIntervalModel[] -

Added intervals

Calculate the working time duration for specific interval, in milliseconds.

ParameterTypeDescription
startDateDate

Start of the interval

endDateDate

End of the interval

Returns: Number -

Returns working time in milliseconds

Calculates the end date of the time interval which starts at startDate and has durationMs working time duration (in milliseconds).

ParameterTypeDescription
startDateDate

Start date

durationMsNumber

Duration in milliseconds

Returns: Date -

The end date

Calculates the start date of the time interval which ends at endDate and has durationMs working time duration (in milliseconds).

ParameterTypeDescription
endDateDate

End date

durationMsNumber

Duration in milliseconds

Returns: Date -

The start date

This method removes all intervals from the internal collection of the calendar

ParameterTypeDescription
silentBoolean

Do not trigger events

Returns non-working time ranges between the provided dates.

ParameterTypeDescription
startDateDate

Start of the period to get ranges from

endDateDate

End of the period to get ranges from

Returns: {name: string, startDate: Date, endDate: Date}[] -

An array of objects representing non-working time ranges

Returns working time ranges between the provided dates.

ParameterTypeDescription
startDateDate

Start of the period to get ranges from

endDateDate

End of the period to get ranges from

Returns: {name: string, startDate: Date, endDate: Date}[] -

An array of objects representing working time ranges

Checks if there is a working time interval in the provided time range

ParameterTypeDescription
startDateDate

Start of the interval

endDateDate

End of the interval

Returns: Boolean -

Returns true if the interval contains working time

Returns the earliest point at which a working period of time starts, following the given date. Can be the date itself, if it occurs during working time.

ParameterTypeDescription
dateDate

The date after which to skip the non-working time

isForwardBoolean

Whether the "following" means forward in time or backward

Returns: Date -

The earliest available date

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

8

Other

cls: String

A CSS class to add to calendar interval elements rendered in the UI.

iconCls: String

A CSS class defining an icon to show in non-working time elements rendered in the UI.

If using the timeZone config, you can set this to true to not convert this calendar to the specified time zone.

Intervals collection of the calendar. Accepts an array as its input, which behind the scenes will be converted to an intervalStore containing the intervals. When serializing it will be converted back to an array.

name: String

The calendar name.

A flag indicating how to treat invalid intervals produced by recurrence start/end rules. The recurrences could be misconfigured, producing unmatched start and end date instances.

The field supports the following set of values:

  • Skip - skip such intervals silently (default)
  • Throw - throw an exception when facing such invalid interval

The flag, indicating, whether the "unspecified" time (time that does not belong to any interval is working (true) or not (false).

Tree

expanded: Boolean= truereadonly

Start expanded or not