Options
All
  • Public
  • Public/Protected
  • All
Menu

Calendar for project scheduling, mixed by CoreCalendarMixin and BaseCalendarMixin. It is used to mark certain time intervals as "non-working" and ignore them during scheduling.

The calendar consists from several intervals. The intervals can be either static or recurrent.

Hierarchy

Index

Properties

$project

The project instance, this entity belongs to.

cls

cls: string

A CSS class to add to non-working time elements rendered in the UI

iconCls

iconCls: string

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

ignoreTimeZone

ignoreTimeZone: boolean

If set to true, the calendar will ignore the project current timeZone setting. Used in the default "weekends" calendar

name

name: string

The calendar name

unspecifiedTimeIsWorking

unspecifiedTimeIsWorking: boolean

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

Methods

accumulateWorkingTime

  • This method starts at the given date and moves forward or backward in time, depending on isForward. It stops moving as soon as it accumulates the durationMs milliseconds of working time and returns the date at which it has stopped and remaining duration - the AccumulateWorkingTimeResult object.

    Normally, the remaining duration will be 0, indicating the full durationMs has been accumulated. However, sometimes, calendar might not be able to accumulate enough working time due to various reasons, like if it does not contain enough working time - this case will be indicated with remaining duration bigger than 0.

    Parameters

    • date: Date
    • durationMs: Duration
    • isForward: boolean

    Returns AccumulateWorkingTimeResult

addInterval

addIntervals

calculateDurationMs

  • calculateDurationMs(startDate: Date, endDate: Date, allowNegative?: Boolean): Duration

calculateEndDate

  • calculateEndDate(startDate: Date, durationMs: Duration): Date | null

calculateStartDate

  • calculateStartDate(endDate: Date, durationMs: Duration): Date | null

clearIntervals

  • clearIntervals(silent?: boolean): boolean

forEachAvailabilityInterval

  • forEachAvailabilityInterval(options: { endDate?: Date; isForward?: boolean; maxRange?: number; startDate?: Date }, func: (startDate: Date, endDate: Date, calendarCacheInterval: CalendarCacheInterval) => any, scope?: object): CalendarIteratorResult
  • The core iterator method of the calendar.

    Parameters

    • options: { endDate?: Date; isForward?: boolean; maxRange?: number; startDate?: Date }

      The options for iterator. Should contain at least one of the startDate/endDate properties which indicates what timespan to examine for availability intervals. If one of boundaries is not provided iterator function should return false at some point, to avoid infinite loops.

      Another recognized option is isForward, which indicates the direction in which to iterate through the timespan.

      • Optional endDate?: Date
      • Optional isForward?: boolean
      • Optional maxRange?: number
      • Optional startDate?: Date
    • func: (startDate: Date, endDate: Date, calendarCacheInterval: CalendarCacheInterval) => any

      The iterator function to call. It will be called for every distinct set of availability intervals, found in the given timespan. All the intervals, which are "active" for current interval are collected in the 3rd argument for this function - calendarCacheInterval. If iterator returns false (checked with ===) the iteration stops.

    • Optional scope: object

      The scope (this value) to execute the iterator in.

    Returns CalendarIteratorResult

getAssignmentStore

  • getAssignmentStore(): this["project"]["assignmentStore"]

getCalendarManagerStore

  • getCalendarManagerStore(): this["project"]["calendarManagerStore"]

getDependencyStore

  • getDependencyStore(): this["project"]["dependencyStore"]

getEventStore

  • getEventStore(): this["project"]["eventStore"]

getNonWorkingTimeRanges

  • getNonWorkingTimeRanges(startDate: Date, endDate: Date, maxRange?: number): { endDate: Date; startDate: Date }[]

getProject

  • getProject(): this["project"]

getResourceStore

  • getResourceStore(): this["project"]["resourceStore"]

getWorkingTimeRanges

  • getWorkingTimeRanges(startDate: Date, endDate: Date, maxRange?: number): { endDate: Date; startDate: Date }[]

isWorkingTime

  • isWorkingTime(startDate: Date, endDate?: Date, fullyContained?: boolean): boolean

joinProject

  • joinProject(): void

leaveProject

  • leaveProject(isReplacing?: boolean): void

removeInterval

removeIntervals

setProject

  • setProject(project: this["project"]): this["project"]

skipNonWorkingTime

  • skipNonWorkingTime(date: Date, isForward?: boolean): Date | null | "empty_calendar"
  • Returns the earliest point at which a working period of time starts, following the given date. Can be the date itself, if it comes on the working time.

    Parameters

    • date: Date

      The date after which to skip the non-working time.

    • Default value isForward: boolean = true

      Whether the "following" means forward in time or backward.

    Returns Date | null | "empty_calendar"

Generated using TypeDoc