Options
All
  • Public
  • Public/Protected
  • All
Menu

The calendar cache for combination of multiple calendars

Hierarchy

Index

Methods

forEachAvailabilityInterval

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

    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.

      Another recognized option is maxRange, which indicates the maximum timespan for this iterator (in milliseconds). When iterator exceeds this timespan, the iteration is stopped and CalendarIteratorResult.MaxRangeReached value is returned. Default value is 5 years.

      • Optional endDate?: Date
      • Optional isForward?: boolean
      • Optional maxRange?: number
      • Optional startDate?: Date
    • func: (startDate: Date, endDate: Date, calendarCacheInterval: CalendarCacheIntervalMultiple) => false | void

      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. If iterator returns false (checked with ===) the iteration stops.

        • (startDate: Date, endDate: Date, calendarCacheInterval: CalendarCacheIntervalMultiple): false | void
        • Parameters

          • startDate: Date
          • endDate: Date
          • calendarCacheInterval: CalendarCacheIntervalMultiple

          Returns false | void

    • Optional scope: object

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

    Returns CalendarIteratorResult

Generated using TypeDoc