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
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-
Identifies an object as an instance of DateRangeOwner class, or subclass thereof.
-
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 is2020-10-25T00:00:00Has a corresponding endDate config.
-
The last day that is included in the date range. This is different than endDate since that date is not inclusive. For example, an
endDateof 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,lastDatewould be 2022-07-20 since that is the last day included in the range. -
Identifies an object as an instance of DateRangeOwner class, or subclass thereof.