v7.3.0

DateRangeOwner
Mixin

Mixin that encapsulates a range of dates specified by a date and a range (such as '1 day', '1 week', or '1 month'). When the date is set, the mixin automatically snaps the start and end dates to the appropriate range boundaries. It also supports explicit startDate / endDate pairs for fixed ranges, and provides navigation methods (next, previous) that shift the range forward or backward by the configured increment.

Calendar views that use this mixin accept range configuration. For example:

const calendar = new Calendar({
    modes : {
        day : {
            // Show 3 days at a time
            range : '3 days'
        },
        list : {
            // Show events for one month
            range : '1 month'
        }
    }
});

// Navigate the active view forward or backward by its range calendar.activeView.next(); calendar.activeView.previous();

See also

  • DayView — View that uses this mixin for date range management
  • EventList — View that uses this mixin for date range management
No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • The start date (Time component is zeroed) of this view.

    Has a corresponding runtime startDate property.

Properties

Properties are getters/setters or publicly accessible variables on this class
  • dateBounds : Date[]
    internal

    Returns the range of included dates in the range as a two-element array, i.e., [0] is startDate and [1] is lastDate.

  • endDate : Date
    READONLY

    Gets the end date of the range that this view covers. Note that Date objects are time points, not a representation of a 24 hour period, So {startDate : '2020-10-24', endDate : '2020-10-25' } spans the single day 24th October 2020. The end point is 2020-10-25T00:00:00

    Has a corresponding endDate config.

  • lastDate : Date
    internal

    The last day that is included in the date range. This is different than endDate since that date is not inclusive. For example, an endDate of 2022-07-21 00:00:00 indicates that the time range ends at that time, and so 2022-07-21 is not in the range. In this example, lastDate would be 2022-07-20 since that is the last day included in the range.

  • startDate : Date
    READONLY

    Gets the start date of the range that this view covers.

    Has a corresponding startDate config.

  • isDateRangeOwner : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of DateRangeOwner class, or subclass thereof.

Functions

Functions are methods available for calling on the class
  • next( )

    Interface method used by an encapsulating Calendar view to implement the "next" button.

  • Interface method used by an encapsulating Calendar view to implement the "prev" button.

Events

Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

Event handlers

Event handlers are callbacks called as a result of certain actions in this class

Source path

Calendar/widget/mixin/DateRangeOwner.js

Contents