fullcalendar
Version:
FullCalendar Vanilla JS package for rendering a calendar
4,134 lines • 172 kB
JavaScript
import { NativeDateFormatter, CmdDateFormatter, FuncDateFormatter, addMs, startOfDay, asRoughMs, addDays, createDuration, durationsEqual, joinDateTimeFormatParts, rangeContainsMarker, buildIsoString, rangesIntersect, rangeContainsRange, diffDays, diffDayAndTime, intersectRanges, invertRanges, rangesEqual } from '@full-ui/headless-calendar';
import { c as classNames } from './2b142f73.js';
import { j as joinClassNames } from './03367050.js';
function createFormatter(input) {
if (typeof input === 'object' && input) { // non-null object
return new NativeDateFormatter(input);
}
if (typeof input === 'string') {
return new CmdDateFormatter(input);
}
if (typeof input === 'function') {
return new FuncDateFormatter(input);
}
return null;
}
function warn(...args) {
console.warn('FullCalendar:', ...args);
}
/* eslint max-classes-per-file: off */
const warnedClassNameOptions = {};
function refineClassName(input, optionName) {
if (!input || typeof input === 'string') {
return input;
}
warnInvalidClassName(optionName);
return '';
}
function refineClassNameGenerator(input, optionName) {
if (typeof input === 'function') {
return (renderProps) => refineClassName(input(renderProps), optionName);
}
return refineClassName(input, optionName);
}
function warnInvalidClassName(optionName) {
if (!warnedClassNameOptions[optionName]) {
warn(`Invalid option \`${optionName}\`: expected a className string or a falsy value.`);
warnedClassNameOptions[optionName] = true;
}
}
// Stops a mouse/touch event from doing it's native browser action
function preventDefault(ev) {
ev.preventDefault();
}
// Event Delegation
// ----------------------------------------------------------------------------------------------------------------
function buildDelegationHandler(selector, handler) {
return (ev) => {
let matchedChild = ev.target.closest(selector);
if (matchedChild) {
handler.call(matchedChild, ev, matchedChild);
}
};
}
function listenBySelector(container, eventType, selector, handler) {
let attachedHandler = buildDelegationHandler(selector, handler);
container.addEventListener(eventType, attachedHandler);
return () => {
container.removeEventListener(eventType, attachedHandler);
};
}
function listenToHoverBySelector(container, selector, onMouseEnter, onMouseLeave) {
let currentMatchedChild;
return listenBySelector(container, 'mouseover', selector, (mouseOverEv, matchedChild) => {
if (matchedChild !== currentMatchedChild) {
currentMatchedChild = matchedChild;
onMouseEnter(mouseOverEv, matchedChild);
let realOnMouseLeave = (mouseLeaveEv) => {
currentMatchedChild = null;
onMouseLeave(mouseLeaveEv, matchedChild);
matchedChild.removeEventListener('mouseleave', realOnMouseLeave);
};
// listen to the next mouseleave, and then unattach
matchedChild.addEventListener('mouseleave', realOnMouseLeave);
}
});
}
// Animation
// ----------------------------------------------------------------------------------------------------------------
const transitionEventNames = [
'webkitTransitionEnd',
'otransitionend',
'oTransitionEnd',
'msTransitionEnd',
'transitionend',
];
// triggered only when the next single subsequent transition finishes
function whenTransitionDone(el, callback) {
let realCallback = (ev) => {
callback(ev);
transitionEventNames.forEach((eventName) => {
el.removeEventListener(eventName, realCallback);
});
};
transitionEventNames.forEach((eventName) => {
el.addEventListener(eventName, realCallback); // cross-browser way to determine when the transition finishes
});
}
// ARIA workarounds
// ----------------------------------------------------------------------------------------------------------------
function createAriaClickAttrs(handler) {
return {
onClick: handler,
...createAriaKeyboardAttrs(handler),
};
}
function createAriaKeyboardAttrs(handler) {
return {
tabIndex: 0,
onKeyDown(ev) {
if (ev.key === 'Enter' || ev.key === ' ') {
handler(ev);
ev.preventDefault(); // if space, don't scroll down page
}
},
};
}
let guidNumber = 0;
function guid() {
guidNumber += 1;
return String(guidNumber);
}
/* FullCalendar-specific DOM Utilities
----------------------------------------------------------------------------------------------------------------------*/
// Make the mouse cursor express that an event is not allowed in the current area
function disableCursor() {
document.body.classList.add(classNames.notAllowed);
}
// Returns the mouse cursor to its original look
function enableCursor() {
document.body.classList.remove(classNames.notAllowed);
}
/* Selection
----------------------------------------------------------------------------------------------------------------------*/
function preventSelection(el) {
el.style.userSelect = 'none';
el.style.webkitUserSelect = 'none';
el.addEventListener('selectstart', preventDefault);
}
function allowSelection(el) {
el.style.userSelect = '';
el.style.webkitUserSelect = '';
el.removeEventListener('selectstart', preventDefault);
}
/* Context Menu
----------------------------------------------------------------------------------------------------------------------*/
function preventContextMenu(el) {
el.addEventListener('contextmenu', preventDefault);
}
function allowContextMenu(el) {
el.removeEventListener('contextmenu', preventDefault);
}
function parseFieldSpecs(input) {
let specs = [];
let tokens = [];
let i;
let token;
if (typeof input === 'string') {
tokens = input.split(/\s*,\s*/);
}
else if (typeof input === 'function') {
tokens = [input];
}
else if (Array.isArray(input)) {
tokens = input;
}
for (i = 0; i < tokens.length; i += 1) {
token = tokens[i];
if (typeof token === 'string') {
specs.push(token.charAt(0) === '-' ?
{ field: token.substring(1), order: -1 } :
{ field: token, order: 1 });
}
else if (typeof token === 'function') {
specs.push({ func: token });
}
}
return specs;
}
function compareByFieldSpecs(obj0, obj1, fieldSpecs) {
let i;
let cmp;
for (i = 0; i < fieldSpecs.length; i += 1) {
cmp = compareByFieldSpec(obj0, obj1, fieldSpecs[i]);
if (cmp) {
return cmp;
}
}
return 0;
}
function compareByFieldSpec(obj0, obj1, fieldSpec) {
if (fieldSpec.func) {
return fieldSpec.func(obj0, obj1);
}
return flexibleCompare(obj0[fieldSpec.field], obj1[fieldSpec.field])
* (fieldSpec.order || 1);
}
function flexibleCompare(a, b) {
if (!a && !b) {
return 0;
}
if (b == null) {
return -1;
}
if (a == null) {
return 1;
}
if (typeof a === 'string' || typeof b === 'string') {
return String(a).localeCompare(String(b));
}
return a - b;
}
/* String Utilities
----------------------------------------------------------------------------------------------------------------------*/
function formatWithOrdinals(formatter, args, fallbackText) {
if (typeof formatter === 'function') {
return formatter(...args);
}
if (typeof formatter === 'string') { // non-blank string
return args.reduce((str, arg, index) => (str.replace('$' + index, arg || '')), formatter);
}
return fallbackText;
}
/* Number Utilities
----------------------------------------------------------------------------------------------------------------------*/
function compareNumbers(a, b) {
return a - b;
}
function valuesIdentical(a, b) {
return a === b;
}
function computeViewBorderless(options) {
const borderless = options.borderless;
return {
borderlessX: Boolean(options.borderlessX ?? borderless),
borderlessTop: Boolean(options.borderlessTop ?? borderless),
borderlessBottom: Boolean(options.borderlessBottom ?? borderless),
};
}
// TODO: new util arrayify?
// Array.prototype.slice.call(
function flatArray(items) {
const res = [];
for (const item of items) {
if (Array.isArray(item)) {
for (const subItem of item) {
res.push(subItem);
}
}
else {
res.push(item);
}
}
return res;
}
function flatMapArray(inputs, mapFunc) {
const res = [];
for (let i = 0; i < inputs.length; i += 1) {
const output = mapFunc(inputs[i], i);
if (Array.isArray(output)) {
for (const subOutput of output) {
res.push(subOutput);
}
}
else {
res.push(output);
}
}
return res;
}
function removeExact(array, exactItem) {
let removeCnt = 0;
let i = 0;
while (i < array.length) {
if (array[i] === exactItem) {
array.splice(i, 1);
removeCnt += 1;
}
else {
i += 1;
}
}
return removeCnt;
}
function isMaybeArraysEqual(array0, array1) {
if (Array.isArray(array0) && Array.isArray(array1)) {
return isArraysEqual(array0, array1);
}
return array0 === array1;
}
function isArraysEqual(array0, array1, itemsEqual = valuesIdentical) {
if (array0 === array1) {
return true;
}
let len = array0.length;
let i;
if (len !== array1.length) { // not array? or not same length?
return false;
}
for (i = 0; i < len; i += 1) {
if (!itemsEqual(array0[i], array1[i])) {
return false;
}
}
return true;
}
const { hasOwnProperty } = Object.prototype;
// Filter / Map
// -------------------------------------------------------------------------------------------------
function filterHash(hash, func) {
let filtered = {};
for (let key in hash) {
if (func(hash[key], key)) {
filtered[key] = hash[key];
}
}
return filtered;
}
function mapHash(hash, func) {
let newHash = {};
for (let key in hash) {
newHash[key] = func(hash[key], key);
}
return newHash;
}
// Conversion
// -------------------------------------------------------------------------------------------------
// Can't use Object.values yet because no es2015 support
// TODO: reassess browser support
// https://caniuse.com/?search=object.values
function hashValuesToArray(obj) {
let a = [];
for (let key in obj) {
a.push(obj[key]);
}
return a;
}
// TODO: rename to stringArrayToHash or something
function arrayToHash(a) {
let hash = {};
for (let item of a) {
hash[item] = true;
}
return hash;
}
// Equality
// -------------------------------------------------------------------------------------------------
function isMaybePropsEqualDepth1(props0, props1) {
if (typeof props0 === 'object' && props0 && // non-null object
typeof props1 === 'object' && props1 // non-null object
) {
return isPropsEqualWithFunc(props0, props1, isPropsEqualShallow);
}
return props0 === props1;
}
function isPropsEqualWithFunc(props0, props1, valuesEqual) {
if (props0 === props1) {
return true;
}
for (let key in props0) {
if (hasOwnProperty.call(props0, key)) {
if (!(key in props1)) {
return false;
}
}
}
for (let key in props1) {
if (hasOwnProperty.call(props1, key)) {
if (!(key in props0) || !valuesEqual(props0[key], props1[key], key)) {
return false;
}
}
}
return true;
}
function isMaybePropsEqualShallow(props0, props1) {
if (typeof props0 === 'object' &&
typeof props1 === 'object' &&
props0 && props1 // both non-null objects
) {
return isPropsEqualShallow(props0, props1);
}
return props0 === props1;
}
function isPropsEqualShallow(props0, props1) {
return isPropsEqualWithFunc(props0, props1, valuesIdentical);
}
/*
For range inputs like { start, end }. Functions are compared by reference
*/
function isMaybeDateRangeInputsEqual(range0, range1) {
if (typeof range0 === 'object' &&
typeof range1 === 'object' &&
range0 && range1 // both non-null objects
) {
return isPropsEqualWithFunc(range0, range1, isDateInputsEqual);
}
return range0 === range1;
}
function isDateInputsEqual(input0, input1) {
if (input0 instanceof Date && input1 instanceof Date) {
return input0.valueOf() === input1.valueOf();
}
if (Array.isArray(input0) && Array.isArray(input1)) {
return isArraysEqual(input0, input1);
}
return input0 === input1;
}
function isPropsEqualWithMap(props0, props1, equalityFuncMap) {
return isPropsEqualWithFunc(props0, props1, (val0, val1, key) => {
const equalityFunc = equalityFuncMap[key];
const isEqual = equalityFunc
? equalityFunc(val0, val1)
: val0 === val1;
// if (debugMessage && !isEqual) {
// console.log(
// debugMessage, key, 'NOT EQUAL', 'rerunning...',
// equalityFunc
// ? equalityFunc(val0, val1)
// : val0 === val1
// )
// }
return isEqual;
});
}
/*
Returns array of keys
*/
function getUnequalProps(props0, props1) {
let keys = [];
for (let key in props0) {
if (hasOwnProperty.call(props0, key)) {
if (!(key in props1)) {
keys.push(key);
}
}
}
for (let key in props1) {
if (hasOwnProperty.call(props1, key)) {
if (props0[key] !== props1[key]) {
keys.push(key);
}
}
}
return keys;
}
// Merge
// -------------------------------------------------------------------------------------------------
function mergeMaybePropsDepth1(props0, props1) {
if (!props0) {
return props1;
}
return mergePropsWithFunc(props0, props1, mergePropsShallow);
}
function mergePropsWithFunc(props0, props1, mergeValues) {
const dest = {};
for (let key in props0) {
if (hasOwnProperty.call(props0, key)) {
if (!(key in props1)) {
dest[key] = props0[key];
}
}
}
for (let key in props1) {
if (hasOwnProperty.call(props1, key)) {
if (!(key in props0)) {
dest[key] = props1[key];
}
else {
dest[key] = mergeValues(props0[key], props1[key]);
}
}
}
return dest;
}
function mergePropsShallow(props0, props1) {
return Object.assign({}, props0, props1);
}
// base options
// ------------
const BASE_OPTION_REFINERS = {
/**
* What happens when the user clicks a day nav link: the name of a view to open, or a function
* receiving the date and native event. By default, the calendar switches to a day view, preferring
* one that has a toolbar button.
* @see https://fullcalendar.io/docs/navLinkDayClick
*/
navLinkDayClick: identity,
/**
* What happens when the user clicks a week nav link (a week number): the name of a view to open, or
* a function receiving the week's start date and native event. By default, the calendar switches to
* a week view, preferring one that has a toolbar button.
* @see https://fullcalendar.io/docs/navLinkWeekClick
*/
navLinkWeekClick: identity,
/**
* The exact length of a view's date range, as a Duration such as `{ days: 4 }`. Mainly used to
* define custom views.
* @see https://fullcalendar.io/docs/duration
*/
duration: createDuration,
/**
* Custom toolbar buttons, plus overrides for the built-in ones (`today`, `prev`, `next`, view
* buttons, and so on), keyed by name. Each entry can set the button's text, hint, click handler,
* icon, and display mode; reference the names in `headerToolbar` or `footerToolbar`.
* @see https://fullcalendar.io/docs/buttons
*/
buttons: identity,
/**
* Custom toolbar elements keyed by name, each a content injection input. Reference the names in
* `headerToolbar` or `footerToolbar` alongside buttons and `title`.
* @see https://fullcalendar.io/docs/toolbarElements
*/
toolbarElements: identity,
/**
* Text for the toolbar's `prev` button. Defined by the locale; only visible when the button
* displays text (see `buttonDisplay`).
*/
prevText: String,
/**
* Text for the toolbar's `next` button. Defined by the locale; only visible when the button
* displays text (see `buttonDisplay`).
*/
nextText: String,
/**
* Text for the toolbar's `prevYear` button. Defined by the locale; only visible when the button
* displays text (see `buttonDisplay`).
*/
prevYearText: String,
/**
* Text for the toolbar's `nextYear` button. Defined by the locale; only visible when the button
* displays text (see `buttonDisplay`).
*/
nextYearText: String,
/**
* Text for the toolbar's `today` button. Defined by the locale; only visible when the button
* displays text (see `buttonDisplay`).
*/
todayText: String,
/**
* Text for the word "year", used for buttons of year-long views and in navigation button hints.
* Defined by the locale.
*/
yearText: String,
/**
* Text for the word "month", used for buttons of month-long views and in navigation button hints.
* Defined by the locale.
*/
monthText: String,
/**
* Text for the word "week", used for buttons of week-long views, navigation button hints, and week
* numbers formatted with `week: 'long'`. Defined by the locale.
* @see https://fullcalendar.io/docs/weekTextLong
*/
weekTextLong: String,
/**
* The short label for week numbers, such as "W", used when week numbers are formatted with
* `week: 'short'` or `week: 'narrow'`. Defined by the locale.
* @see https://fullcalendar.io/docs/weekTextShort
*/
weekTextShort: String,
/**
* Text for the word "day", used for buttons of day-long views and in navigation button hints.
* Defined by the locale.
*/
dayText: String,
/**
* Text for the toolbar buttons of list views. If `false`, list view buttons use the text of their
* duration's unit, such as "Week". Defined by the locale.
*/
listText: identity,
/**
* The accessible label for the `today` button. A string where `$0` is replaced by the current
* unit's text (such as "month"), or a function receiving that text and the unit name. Defined by
* the locale.
*/
todayHint: identity,
/**
* The accessible label for the `prev` button, and for `prevYear` (with "year" as the text). A
* string where `$0` is replaced by the current unit's text (such as "month"), or a function
* receiving that text and the unit name. Defined by the locale.
*/
prevHint: identity,
/**
* The accessible label for the `next` button, and for `nextYear` (with "year" as the text). A
* string where `$0` is replaced by the current unit's text (such as "month"), or a function
* receiving that text and the unit name. Defined by the locale.
*/
nextHint: identity,
// TODO: make type for hint input
/**
* Whether toolbar buttons show an icon, text, or both: `'auto'` (the default; an icon if the theme
* provides one, otherwise text), `'icon'`, `'text'`, `'icon-text'`, or `'text-icon'`. Individual
* buttons can override this via `buttons`.
* @see https://fullcalendar.io/docs/buttonDisplay
*/
buttonDisplay: identity,
/**
* Class names for buttons joined with commas in the toolbar setting (e.g. "prev,next"), shown as
* one group. A string, or a function that receives `ButtonGroupInfo` and returns one.
* @see https://fullcalendar.io/docs/toolbar-render-hooks
*/
buttonGroupClass: refineClassNameGenerator,
/**
* Class names for a single toolbar button, such as prev, next, today or a view name. A string, or a
* function that receives `ButtonInfo` and returns one.
* @see https://fullcalendar.io/docs/toolbar-render-hooks
*/
buttonClass: refineClassNameGenerator,
/**
* The duration assumed for all-day events that have no `end`. The event's actual `end` stays unset
* unless `forceEventDuration` is `true`.
* @see https://fullcalendar.io/docs/defaultAllDayEventDuration
*/
defaultAllDayEventDuration: createDuration,
/**
* The duration assumed for timed events that have no `end`. The event's actual `end` stays unset
* unless `forceEventDuration` is `true`.
* @see https://fullcalendar.io/docs/defaultTimedEventDuration
*/
defaultTimedEventDuration: createDuration,
/**
* How far a timed event must extend into a day before it is displayed on that day, as a Duration
* such as `'09:00'`. Applies to day-based layouts like DayGrid, list, and day-slotted timeline
* views, not TimeGrid.
* @see https://fullcalendar.io/docs/nextDayThreshold
*/
nextDayThreshold: createDuration,
/**
* The time of day the view is initially scrolled to in time-axis views, as a Duration such as
* `'08:00'`. Earlier times remain reachable by scrolling.
* @see https://fullcalendar.io/docs/scrollTime
*/
scrollTime: createDuration,
/**
* Whether the view scrolls back to `scrollTime` each time the date range changes.
* @see https://fullcalendar.io/docs/scrollTimeReset
*/
scrollTimeReset: Boolean,
/**
* The first time of day displayed in time-axis views, as a Duration such as `'08:00'`. Defaults to
* midnight.
* @see https://fullcalendar.io/docs/slotMinTime
*/
slotMinTime: createDuration,
/**
* The time of day at which time-axis views end, as an exclusive Duration such as `'18:00'`.
* Defaults to `'24:00'`.
* @see https://fullcalendar.io/docs/slotMaxTime
*/
slotMaxTime: createDuration,
/**
* The date format of the title in the "+more" event popover, as a date formatter.
* @see https://fullcalendar.io/docs/popoverFormat
*/
popoverFormat: createFormatter,
/**
* The length of each time slot in TimeGrid and timeline views, as a Duration such as `'00:15:00'`.
* @see https://fullcalendar.io/docs/slotDuration
*/
slotDuration: createDuration,
/**
* The time interval that dragged events and date selections snap to, as a Duration. Defaults to
* `slotDuration`.
* @see https://fullcalendar.io/docs/snapDuration
*/
snapDuration: createDuration,
/**
* The buttons and title displayed above the calendar. An object whose `start`, `center`, and
* `end` properties are strings like `'prev,next today'`. Omit or set `false` for no toolbar.
* @see https://fullcalendar.io/docs/headerToolbar
*/
headerToolbar: identity,
/**
* The buttons and title displayed below the calendar. Accepts the same values as `headerToolbar`;
* omit or set `false` for no footer toolbar.
* @see https://fullcalendar.io/docs/footerToolbar
*/
footerToolbar: identity,
/**
* Whether events without an `end` get one assigned, computed from `defaultTimedEventDuration` or
* `defaultAllDayEventDuration`.
* @see https://fullcalendar.io/docs/forceEventDuration
*/
forceEventDuration: Boolean,
// TODO: move to timegrid
/**
* Class names for one day's vertical column of time slots, where its timed events appear. A string,
* or a function that receives `DayLaneInfo` and returns one.
* @see https://fullcalendar.io/docs/day-lane-render-hooks
*/
dayLaneClass: refineClassNameGenerator,
/**
* Class names for the wrapper inside a day lane that holds its timed events. A string, or a
* function that receives `DayLaneInfo` and returns one.
* @see https://fullcalendar.io/docs/day-lane-render-hooks
*/
dayLaneInnerClass: refineClassNameGenerator,
/**
* Called right after each `dayLane` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/day-lane-render-hooks
*/
dayLaneDidMount: identity,
/**
* Called right before each `dayLane` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/day-lane-render-hooks
*/
dayLaneWillUnmount: identity,
/**
* The view shown when the calendar first loads, such as `'dayGridMonth'` or `'timeGridWeek'`.
* If omitted, the default view of the first plugin that provides one is used.
* @see https://fullcalendar.io/docs/initialView
*/
initialView: String,
/**
* The width-to-height ratio of the calendar's view area, used to size the calendar when neither
* `height` nor `contentHeight` is set. Larger numbers make a shorter calendar.
* @see https://fullcalendar.io/docs/aspectRatio
*/
aspectRatio: Number,
/**
* Whether to include Saturday and Sunday in the calendar's views.
* @see https://fullcalendar.io/docs/weekends
*/
weekends: Boolean,
/**
* How week numbers are calculated: `'local'` (the locale's method, the default), `'ISO'`, or a
* function that receives a Date and returns a week number.
* @see https://fullcalendar.io/docs/weekNumberCalculation
*/
weekNumberCalculation: identity,
/**
* Whether to display week numbers: in each row of DayGrid views with more than one row, in the
* corner of TimeGrid views, and as a header row in timeline views with day or hour slots.
* @see https://fullcalendar.io/docs/weekNumbers
*/
weekNumbers: Boolean,
/**
* Class names for the corner cell above the time axis that shows the week number, in TimeGrid
* views. A string, or a function that receives `WeekNumberHeaderInfo` and returns one.
* @see https://fullcalendar.io/docs/week-number-header-render-hooks
*/
weekNumberHeaderClass: refineClassNameGenerator,
/**
* Class names for the text wrapper inside the week-number header. A string, or a function that
* receives `WeekNumberHeaderInfo` and returns one.
* @see https://fullcalendar.io/docs/week-number-header-render-hooks
*/
weekNumberHeaderInnerClass: refineClassNameGenerator,
/**
* Custom content for each `weekNumberHeader` part, injected inside it in place of its default
* content.
* @see https://fullcalendar.io/docs/week-number-header-render-hooks
*/
weekNumberHeaderContent: identity,
/**
* Called right after each `weekNumberHeader` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/week-number-header-render-hooks
*/
weekNumberHeaderDidMount: identity,
/**
* Called right before each `weekNumberHeader` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/week-number-header-render-hooks
*/
weekNumberHeaderWillUnmount: identity,
/**
* Class names for the week number shown inside the first day cell of each row, in day grids. A
* string, or a function that receives `InlineWeekNumberInfo` and returns one.
* @see https://fullcalendar.io/docs/inline-week-number-render-hooks
*/
inlineWeekNumberClass: refineClassNameGenerator,
/**
* Custom content for each `inlineWeekNumber` part, injected inside it in place of its default
* content.
* @see https://fullcalendar.io/docs/inline-week-number-render-hooks
*/
inlineWeekNumberContent: identity,
/**
* Called right after each `inlineWeekNumber` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/inline-week-number-render-hooks
*/
inlineWeekNumberDidMount: identity,
/**
* Called right before each `inlineWeekNumber` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/inline-week-number-render-hooks
*/
inlineWeekNumberWillUnmount: identity,
/**
* Whether events can be dragged and resized. Requires the interaction plugin. Use
* `eventStartEditable` or `eventDurationEditable` to control each separately.
* @see https://fullcalendar.io/docs/editable
*/
editable: Boolean,
controller: identity,
/**
* Whether to display a marker at the current time in TimeGrid and timeline views. It repositions
* itself as time passes.
* @see https://fullcalendar.io/docs/nowIndicator
*/
nowIndicator: Boolean,
/**
* Whether the now indicator snaps to the start of the current time unit (such as the hour) instead
* of tracking the exact time. `'auto'` (the default) decides based on the view's slot duration.
*/
nowIndicatorSnap: identity,
/**
* Class names for the marker for the current time on the time axis. A string, or a function that
* receives `NowIndicatorHeaderInfo` and returns one.
* @see https://fullcalendar.io/docs/now-indicator-header-render-hooks
*/
nowIndicatorHeaderClass: refineClassNameGenerator,
/**
* Content rendered inside each `nowIndicatorHeader` part, which is otherwise empty.
* @see https://fullcalendar.io/docs/now-indicator-header-render-hooks
*/
nowIndicatorHeaderContent: identity,
/**
* Called right after each `nowIndicatorHeader` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/now-indicator-header-render-hooks
*/
nowIndicatorHeaderDidMount: identity,
/**
* Called right before each `nowIndicatorHeader` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/now-indicator-header-render-hooks
*/
nowIndicatorHeaderWillUnmount: identity,
/**
* Class names for the dot on the time axis beside the current-time line. A string only; functions
* are not accepted.
* @see https://fullcalendar.io/docs/now-indicator-dot-render-hooks
*/
nowIndicatorDotClass: refineClassName,
/**
* Class names for the line marking the current time across the slots. A string, or a function that
* receives `NowIndicatorLineInfo` and returns one.
* @see https://fullcalendar.io/docs/now-indicator-line-render-hooks
*/
nowIndicatorLineClass: refineClassNameGenerator,
/**
* Content rendered inside each `nowIndicatorLine` part, which is otherwise empty.
* @see https://fullcalendar.io/docs/now-indicator-line-render-hooks
*/
nowIndicatorLineContent: identity,
/**
* Called right after each `nowIndicatorLine` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/now-indicator-line-render-hooks
*/
nowIndicatorLineDidMount: identity,
/**
* Called right before each `nowIndicatorLine` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/now-indicator-line-render-hooks
*/
nowIndicatorLineWillUnmount: identity,
/**
* In month views, whether to render the dates from the previous and next months that fill out the
* first and last weeks. When `false`, those cells are blank and show no events.
* @see https://fullcalendar.io/docs/showNonCurrentDates
*/
showNonCurrentDates: Boolean,
/**
* Whether to fetch events only when the calendar needs dates it has not already fetched. When
* `false`, events are refetched whenever the view or date range changes.
* @see https://fullcalendar.io/docs/lazyFetching
*/
lazyFetching: Boolean,
/**
* The name of the query parameter that JSON feed requests use for the start of the requested range.
* Defaults to `'start'`.
* @see https://fullcalendar.io/docs/startParam
*/
startParam: String,
/**
* The name of the query parameter that JSON feed requests use for the exclusive end of the
* requested range. Defaults to `'end'`.
* @see https://fullcalendar.io/docs/endParam
*/
endParam: String,
/**
* The name of the query parameter that JSON feed requests use for the calendar's time zone. Not
* sent when `timeZone` is `'local'`. Defaults to `'timeZone'`.
* @see https://fullcalendar.io/docs/timeZoneParam
*/
timeZoneParam: String,
/**
* The time zone used to display and interpret dates: `'local'` (the default), `'UTC'`, or a
* named IANA time zone such as `'America/New_York'`.
* @see https://fullcalendar.io/docs/timeZone
*/
timeZone: String,
/**
* Locale definitions to make available to the calendar, such as imported locale files. The active
* one is chosen with `locale`.
* @see https://fullcalendar.io/docs/locale
*/
locales: identity,
/**
* The locale used for the calendar's text, date formats, first day of the week, and week numbering.
* A locale code such as `'es'` (it must be loaded via `locales` or imported globally), or a locale
* object.
* @see https://fullcalendar.io/docs/locale
*/
locale: identity,
/**
* How long, in milliseconds, an event takes to animate back to its original position after an
* unsuccessful drag.
* @see https://fullcalendar.io/docs/dragRevertDuration
*/
dragRevertDuration: Number,
/**
* Whether scroll containers automatically scroll when the pointer nears their edge while dragging
* an event or selecting dates.
* @see https://fullcalendar.io/docs/dragScroll
*/
dragScroll: Boolean,
/**
* Whether an event keeps roughly the same duration when dragged between the all-day section and the
* time slots. When `false`, its duration resets to `defaultAllDayEventDuration` or
* `defaultTimedEventDuration`.
* @see https://fullcalendar.io/docs/allDayMaintainDuration
*/
allDayMaintainDuration: Boolean,
/**
* Whether clicking elsewhere on the page clears the current date selection. See also
* `unselectCancel`.
* @see https://fullcalendar.io/docs/unselectAuto
*/
unselectAuto: Boolean,
/**
* Which external draggable elements may be dropped onto the calendar: a CSS selector, or a
* function that receives the draggable element and returns `true` to accept it.
* @see https://fullcalendar.io/docs/dropAccept
*/
dropAccept: identity, // TODO: type draggable
/**
* The sort order for events that occupy the same day or time: event field names (prefix with `-`
* for descending) as a comma-separated string or array, or a comparison function. Defaults to
* `'start,-duration,allDay,title'`.
* @see https://fullcalendar.io/docs/eventOrder
*/
eventOrder: parseFieldSpecs,
/**
* Whether to follow `eventOrder` strictly. By default, the order is relaxed when doing so makes the
* layout more compact.
* @see https://fullcalendar.io/docs/eventOrderStrict
*/
eventOrderStrict: Boolean,
/**
* Whether a multi-day event in a DayGrid view can be split around a "+more" link. When `false`, the
* whole event is hidden into the "+more" link if any of its days overflows.
* @see https://fullcalendar.io/docs/eventSlicing
*/
eventSlicing: Boolean, // default: true
/**
* How events are laid out in TimeGrid views when printing: `'auto'` (the default; stacked in
* browsers that print positioned elements poorly, such as Firefox), `'stack'`, or `'grid'`.
* Printing requires the premium adaptive plugin.
* @see https://fullcalendar.io/docs/eventPrintLayout
*/
eventPrintLayout: String,
/**
* On touch devices, how long in milliseconds the user must hold down before dragging an event or
* selecting dates. `eventLongPressDelay` and `selectLongPressDelay` override it for each case.
* @see https://fullcalendar.io/docs/longPressDelay
*/
longPressDelay: Number,
/**
* How many pixels the mouse must move before an event drag begins.
* @see https://fullcalendar.io/docs/eventDragMinDistance
*/
eventDragMinDistance: Number,
/**
* Whether the time slots of TimeGrid and resource timeline views stretch to fill the view's height
* when they would otherwise leave empty space.
* @see https://fullcalendar.io/docs/expandRows
*/
expandRows: Boolean,
/**
* The height of the whole calendar, including toolbars: a number of pixels, `'auto'` for the
* natural height with no scrolling, or any CSS value such as `'100%'`. If unset, the height is
* derived from `contentHeight` or `aspectRatio`.
* @see https://fullcalendar.io/docs/height
*/
height: identity,
/**
* The height of the calendar's view area, excluding toolbars: a number of pixels, a CSS value, or
* `'auto'` for the natural height with no scrolling. Ignored if `height` is set.
* @see https://fullcalendar.io/docs/contentHeight
*/
contentHeight: identity,
/**
* The text direction of the calendar: `'ltr'` or `'rtl'`. Defaults to the locale's direction.
* @see https://fullcalendar.io/docs/direction
*/
direction: String,
/**
* The calendar's color scheme, such as `'light'` or `'dark'`, applied to its root element,
* popovers, and drag mirrors as a `data-color-scheme` attribute. If unset, the scheme is inherited
* from an ancestor's `data-color-scheme` attribute.
* @see https://fullcalendar.io/docs/color-palettes
*/
colorScheme: String,
/**
* The date format of week number text, as a date formatter such as `{ week: 'narrow' }`. The label
* comes from `weekTextShort` or `weekTextLong`.
* @see https://fullcalendar.io/docs/weekNumberFormat
*/
weekNumberFormat: createFormatter,
/**
* Whether the user can resize an event from its starting edge, in addition to its ending edge.
* @see https://fullcalendar.io/docs/eventResizableFromStart
*/
eventResizableFromStart: Boolean,
/**
* Whether to display the time text of timed events. If unset, each view chooses its own default.
* @see https://fullcalendar.io/docs/displayEventTime
*/
displayEventTime: Boolean,
/**
* Whether to include the end time in an event's time text. If unset, each view chooses its own
* default.
* @see https://fullcalendar.io/docs/displayEventEnd
*/
displayEventEnd: Boolean,
/**
* Whether to render each event source as soon as it arrives, rather than waiting for all sources to
* finish fetching and rendering them together.
* @see https://fullcalendar.io/docs/progressiveEventRendering
*/
progressiveEventRendering: Boolean,
/**
* Highlights business hours and dims the rest. `true` uses Monday to Friday, 9am to 5pm; an object
* or array of objects with `daysOfWeek`, `startTime`, and `endTime` sets custom hours.
* @see https://fullcalendar.io/docs/businessHours
*/
businessHours: identity,
/**
* The date the calendar displays when it first loads, as anything that parses into a date, such as
* `'2026-02-01'`. Defaults to today.
* @see https://fullcalendar.io/docs/initialDate
*/
initialDate: identity,
/**
* The calendar's current date and time, used for "today" highlighting and the now indicator. A
* parsable date, or a function returning one. Defaults to the system clock.
* @see https://fullcalendar.io/docs/now
*/
now: identity,
/**
* A function that converts each raw event received from an event source into a parsable event
* object, or returns `false` to discard it. Not called for `addEvent`.
* @see https://fullcalendar.io/docs/eventDataTransform
*/
eventDataTransform: identity,
/**
* Whether the view's date headers stick to the top of the viewport while the page scrolls: `true`,
* `false`, or `'auto'` (the default; sticky when `height` or `contentHeight` is `'auto'`).
* @see https://fullcalendar.io/docs/tableHeaderSticky
*/
tableHeaderSticky: identity,
/**
* Whether a view's horizontal scrollbar sticks to the bottom of the viewport while the page
* scrolls: `true`, `false`, or `'auto'` (the default). It only sticks when `height` or
* `contentHeight` is `'auto'`, and `'auto'` turns it on in that case.
* @see https://fullcalendar.io/docs/footerScrollbarSticky
*/
footerScrollbarSticky: identity,
/**
* The `allDay` value assigned to events that do not specify one. If unset, `allDay` is guessed from
* the event's start and end values.
* @see https://fullcalendar.io/docs/defaultAllDay
*/
defaultAllDay: Boolean,
/**
* Called when fetching from an event source fails, with an error object. For JSON feeds, the
* error's `response` property holds the HTTP response.
* @see https://fullcalendar.io/docs/eventSourceFailure
*/
eventSourceFailure: identity,
/**
* Called when an event source fetch succeeds, with the raw event data and, for JSON feeds, the HTTP
* response. It may return a new array of event inputs to use instead.
* @see https://fullcalendar.io/docs/eventSourceSuccess
*/
eventSourceSuccess: identity,
/**
* The default rendering style for events: `'auto'`, `'block'`, `'list-item'`, `'background'`,
* `'inverse-background'`, or `'none'`. Event sources and individual events can override it with
* their `display` property.
* @see https://fullcalendar.io/docs/eventDisplay
*/
eventDisplay: String, // TODO: give more specific
/**
* Whether events can be dragged to change their start. Overrides `editable` for dragging; requires
* the interaction plugin.
* @see https://fullcalendar.io/docs/eventStartEditable
*/
eventStartEditable: Boolean,
/**
* Whether events can be resized to change their duration. Overrides `editable` for resizing;
* requires the interaction plugin.
* @see https://fullcalendar.io/docs/eventDurationEditable
*/
eventDurationEditable: Boolean,
/**
* Whether events being dragged or resized may overlap other events. `true`, `false`, or a function
* that receives the stationary and moving events and returns whether that overlap is allowed.
* @see https://fullcalendar.io/docs/eventOverlap
*/
eventOverlap: identity,
/**
* Limits where events can be dragged or resized: an event `groupId`, `'businessHours'`, or an
* object describing a time window or date range that the event must stay within.
* @see https://fullcalendar.io/docs/eventConstraint
*/
eventConstraint: identity,
/**
* A function that decides whether an event may be dragged or resized to a given location. It
* receives the proposed date span and the event, and returns `true` to allow it.
* @see https://fullcalendar.io/docs/eventAllow
*/
eventAllow: identity,
/**
* The color of all foreground events, as any CSS color. Event sources and individual events can
* override it with their `color` property.
* @see https://fullcalendar.io/docs/eventColor
*/
eventColor: String,
/**
* The color used for text and other elements drawn on top of events' color, as any CSS color. Event
* sources and individual events can override it with their `contrastColor` property.
* @see https://fullcalendar.io/docs/eventContrastColor
*/
eventContrastColor: String,
/**
* Called right after each `event` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/event-render-hooks
*/
eventDidMount: identity,
/**
* Called right before each `event` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/event-render-hooks
*/
eventWillUnmount: identity,
/**
* Custom content for each event, rendered as the content of its `eventInner` element in place of
* the default time and title.
* @see https://fullcalendar.io/docs/event-render-hooks
*/
eventContent: identity,
/**
* Class names for every foreground event, in any view. More specific options also apply:
* `blockEventClass` plus `rowEventClass` or `columnEventClass` for block events, or
* `listItemEventClass` for list-item events. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/event-render-hooks
*/
eventClass: refineClassNameGenerator,
/**
* Class names for the wrapper around an event's time and title. A string, or a function that
* receives `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/event-render-hooks
*/
eventInnerClass: refineClassNameGenerator,
/**
* Class names for an event's time text. A string, or a function that receives `EventTextInfo` and
* returns one.
* @see https://fullcalendar.io/docs/event-render-hooks
*/
eventTimeClass: refineClassNameGenerator,
/**
* Class names for an event's title text. A string, or a function that receives `EventTextInfo` and
* returns one.
* @see https://fullcalendar.io/docs/event-render-hooks
*/
eventTitleClass: refineClassNameGenerator,
/**
* Class names for an element before an event's content, used for decoration and as the start
* resize handle. Rendered only when it has class names, or content from `rowEventBeforeContent` in
* row events. A string, or a function that receives `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/event-render-hooks
*/
eventBeforeClass: refineClassNameGenerator,
/**
* Class names for an element after an event's content, used for decoration and as the end resize
* handle. Rendered only when it has class names, or content from `rowEventAfterContent` in row
* events. A string, or a function that receives `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/event-render-hooks
*/
eventAfterClass: refineClassNameGenerator,
//
/**
* Class names for a bullet-point event with a colored dot: single-day timed events in DayGrid
* views (or any event with `display: 'list-item'`), and every event in list views. A string, or a
* function that receives `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/list-item-event-render-hooks
*/
listItemEventClass: refineClassNameGenerator,
/**
* Class names for the content wrapper of a list item event. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/list-item-event-render-hooks
*/
listItemEventInnerClass: refineClassNameGenerator,
/**
* Class names for the time text of a list item event. A string, or a function that receives
* `EventTextInfo` and returns one.
* @see https://fullcalendar.io/docs/list-item-event-render-hooks
*/
listItemEventTimeClass: refineClassNameGenerator,
/**
* Class names for the title text of a list item event. A string, or a function that receives
* `EventTextInfo` and returns one.
* @see https://fullcalendar.io/docs/list-item-event-render-hooks
*/
listItemEventTitleClass: refineClassNameGenerator,
/**
* Class names for the before element of a list item event. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/list-item-event-render-hooks
*/
listItemEventBeforeClass: refineClassNameGenerator,
/**
* Class names for the after element of a list item event. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/list-item-event-render-hooks
*/
listItemEventAfterClass: refineClassNameGenerator,
//
/**
* Class names for a color-filled rectangular event: every event except list items. A string, or a
* function that receives `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/block-event-render-hooks
*/
blockEventClass: refineClassNameGenerator,
/**
* Class names for the content wrapper of a block event. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/block-event-render-hooks
*/
blockEventInnerClass: refineClassNameGenerator,
/**
* Class names for the time text of a block event. A string, or a function that receives
* `EventTextInfo` and returns one.
* @see https://fullcalendar.io/docs/block-event-render-hooks
*/
blockEventTimeClass: refineClassNameGenerator,
/**
* Class names for the title text of a block event. A string, or a function that receives
* `EventTextInfo` and returns one.
* @see https://fullcalendar.io/docs/block-event-render-hooks
*/
blockEventTitleClass: refineClassNameGenerator,
/**
* Class names for the before element of a block event. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/block-event-render-hooks
*/
blockEventBeforeClass: refineClassNameGenerator,
/**
* Class names for the after element of a block event. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/block-event-render-hooks
*/
blockEventAfterClass: refineClassNameGenerator,
//
/**
* Class names for a horizontal bar event: all-day and multi-day events in day grids, all-day events
* in time grids, and timeline events. A string, or a function that receives `EventDisplayInfo` and
* returns one.
* @see https://fullcalendar.io/docs/row-event-render-hooks
*/
rowEventClass: refineClassNameGenerator,
/**
* Class names for the content wrapper of a row event. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/row-event-render-hooks
*/
rowEventInnerClass: refineClassNameGenerator,
/**
* Class names for the time text of a row event, when it shows one. A string, or a function that
* receives `EventTextInfo` and returns one.
* @see https://fullcalendar.io/docs/row-event-render-hooks
*/
rowEventTimeClass: refineClassNameGenerator,
/**
* Class names for the title text of a row event. A string, or a function that receives
* `EventTextInfo` and returns one.
* @see https://fullcalendar.io/docs/row-event-render-hooks
*/
rowEventTitleClass: refineClassNameGenerator,
/**
* Whether a row event's title stays in view when the event is partly scrolled out horizontally, for
* example in timeline views.
* @see https://fullcalendar.io/docs/row-event-render-hooks
*/
rowEventTitleSticky: Boolean,
/**
* Class names for the before element of a row event. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/row-event-render-hooks
*/
rowEventBeforeClass: refineClassNameGenerator,
/**
* Content rendered inside each row event's `rowEventBefore` element, which is otherwise empty.
* @see https://fullcalendar.io/docs/row-event-render-hooks
*/
rowEventBeforeContent: identity,
/**
* Class names for the after element of a row event. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/row-event-render-hooks
*/
rowEventAfterClass: refineClassNameGenerator,
/**
* Content rendered inside each row event's `rowEventAfter` element, which is otherwise empty.
* @see https://fullcalendar.io/docs/row-event-render-hooks
*/
rowEventAfterContent: identity,
//
/**
* Class names for a vertical event in a day lane: timed events in time grids. A string, or a
* function that receives `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/column-event-render-hooks
*/
columnEventClass: refineClassNameGenerator,
/**
* Class names for the content wrapper of a column event. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/column-event-render-hooks
*/
columnEventInnerClass: refineClassNameGenerator,
/**
* Class names for the time text of a column event. A string, or a function that receives
* `EventTextInfo` and returns one.
* @see https://fullcalendar.io/docs/column-event-render-hooks
*/
columnEventTimeClass: refineClassNameGenerator,
/**
* Class names for the title text of a column event. A string, or a function that receives
* `EventTextInfo` and returns one.
* @see https://fullcalendar.io/docs/column-event-render-hooks
*/
columnEventTitleClass: refineClassNameGenerator,
/**
* Whether a column event's title stays in view when the event is partly scrolled out vertically, in
* TimeGrid views.
* @see https://fullcalendar.io/docs/column-event-render-hooks
*/
columnEventTitleSticky: Boolean,
/**
* Class names for the before element of a column event. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/column-event-render-hooks
*/
columnEventBeforeClass: refineClassNameGenerator,
/**
* Class names for the after element of a column event. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/column-event-render-hooks
*/
columnEventAfterClass: refineClassNameGenerator,
//
/**
* Class names for a background event: shading behind a day or time range. A string, or a function
* that receives `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/background-event-render-hooks
*/
backgroundEventClass: refineClassNameGenerator,
/**
* Called right after each `backgroundEvent` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/background-event-render-hooks
*/
backgroundEventDidMount: identity,
/**
* Called right before each `backgroundEvent` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/background-event-render-hooks
*/
backgroundEventWillUnmount: identity,
/**
* Custom content for each `backgroundEvent` part, injected inside it in place of its default
* content.
* @see https://fullcalendar.io/docs/background-event-render-hooks
*/
backgroundEventContent: identity,
/**
* Class names for the wrapper inside a background event. A string, or a function that receives
* `EventDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/background-event-render-hooks
*/
backgroundEventInnerClass: refineClassNameGenerator,
/**
* Class names for a background event's title text, where shown. A string, or a function that
* receives `EventTextInfo` and returns one.
* @see https://fullcalendar.io/docs/background-event-render-hooks
*/
backgroundEventTitleClass: refineClassNameGenerator,
/**
* The color of all background events, as any CSS color.
* @see https://fullcalendar.io/docs/backgroundEventColor
*/
backgroundEventColor: String,
/**
* Limits where the user can select dates: an event `groupId`, `'businessHours'`, or an object
* describing a time window or date range that the selection must stay within.
* @see https://fullcalendar.io/docs/selectConstraint
*/
selectConstraint: identity,
/**
* Whether the user may select a range that overlaps events. `true`, `false`, or a function that
* receives each overlapping event and returns whether that overlap is allowed.
* @see https://fullcalendar.io/docs/selectOverlap
*/
selectOverlap: identity,
/**
* A function that decides whether a potential date selection is allowed. It receives information
* about the selection and returns `true` to allow it.
* @see https://fullcalendar.io/docs/selectAllow
*/
selectAllow: identity,
/**
* Whether events dragged from other calendars can be dropped onto this one. Also requires
* `editable` and the interaction plugin. External draggable elements can be dropped regardless of
* this setting; filter them with `dropAccept`.
* @see https://fullcalendar.io/docs/droppable
*/
droppable: Boolean,
/**
* A CSS selector for elements that do not clear the current date selection when clicked, despite
* `unselectAuto`.
* @see https://fullcalendar.io/docs/unselectCancel
*/
unselectCancel: String,
/**
* The date format of time slot labels in TimeGrid and timeline views. Timeline views also accept an
* array of formats, one per header row.
* @see https://fullcalendar.io/docs/slotHeaderFormat
*/
slotHeaderFormat: identity,
/**
* Class names for one time slot's long strip: across all days in a time grid, down through all
* resources in a timeline. A string, or a function that receives `SlotLaneInfo` and returns one.
* @see https://fullcalendar.io/docs/slot-lane-render-hooks
*/
slotLaneClass: refineClassNameGenerator,
/**
* Called right after each `slotLane` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/slot-lane-render-hooks
*/
slotLaneDidMount: identity,
/**
* Called right before each `slotLane` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/slot-lane-render-hooks
*/
slotLaneWillUnmount: identity,
/**
* Class names for one time label: on the left of a time grid, or along the top of a timeline. A
* string, or a function that receives `SlotHeaderInfo` and returns one.
* @see https://fullcalendar.io/docs/slot-header-render-hooks
*/
slotHeaderClass: refineClassNameGenerator,
/**
* Class names for the text wrapper inside a time label; may be a nav link in timelines. A string,
* or a function that receives `SlotHeaderInfo` and returns one.
* @see https://fullcalendar.io/docs/slot-header-render-hooks
*/
slotHeaderInnerClass: refineClassNameGenerator,
/**
* Custom content for each `slotHeader` part, injected inside it in place of its default content.
* @see https://fullcalendar.io/docs/slot-header-render-hooks
*/
slotHeaderContent: identity,
/**
* Called right after each `slotHeader` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/slot-header-render-hooks
*/
slotHeaderDidMount: identity,
/**
* Called right before each `slotHeader` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/slot-header-render-hooks
*/
slotHeaderWillUnmount: identity,
/**
* The horizontal alignment of slot header text in timeline views: `'start'`, `'center'`, or
* `'end'`, or a function of the header's `level` and `isTime` that returns one.
* @see https://fullcalendar.io/docs/slot-header-render-hooks
*/
slotHeaderAlign: identity,
/**
* In timeline views, whether the labels in the upper slot header rows (such as the dates above the
* times) stay in view while scrolling horizontally. A number or CSS length sets their offset from
* the edge.
* @see https://fullcalendar.io/docs/slot-header-render-hooks
*/
slotHeaderSticky: identity,
/**
* Class names for the row of time labels above a timeline. A string only; functions are not
* accepted.
* @see https://fullcalendar.io/docs/slot-header-row-render-hooks
*/
slotHeaderRowClass: refineClassName,
/**
* Class names for the line between the time labels and the slots. A string, or a function of the
* part's info that returns one.
* @see https://fullcalendar.io/docs/slot-header-divider-render-hooks
*/
slotHeaderDividerClass: refineClassNameGenerator,
/**
* The maximum number of events to show in a day cell, not counting the "+more" link that reveals
* the rest in a popover. If `true`, the limit is determined by the height of the cell (in
* TimeGrid's all-day section, five rows).
* @see https://fullcalendar.io/docs/dayMaxEvents
*/
dayMaxEvents: identity,
/**
* The maximum number of event rows in a day cell, including the "+more" link that reveals the rest
* in a popover. If `true`, the limit is determined by the height of the cell (in TimeGrid's all-day
* section, five rows).
* @see https://fullcalendar.io/docs/dayMaxEventRows
*/
dayMaxEventRows: identity,
/**
* A minimum width in pixels for day columns in DayGrid, TimeGrid, and vertical resource views;
* below it, the view scrolls horizontally. Requires the premium scrollgrid plugin.
* @see https://fullcalendar.io/docs/dayMinWidth
*/
dayMinWidth: Number,
/**
* How often time slots are labeled, as a Duration such as `'01:00'`. If unset, an interval is
* computed from `slotDuration`.
* @see https://fullcalendar.io/docs/slotHeaderInterval
*/
slotHeaderInterval: createDuration,
// in core because more-popover needs it
/**
* Class names for a header cell naming one day of the week or one date, above its column. Also the
* date heading in the "+more" popover. A string, or a function that receives `DayHeaderInfo` and
* returns one.
* @see https://fullcalendar.io/docs/day-header-render-hooks
*/
dayHeaderClass: refineClassNameGenerator,
/**
* Class names for the text wrapper inside a day header; may be a nav link. A string, or a function
* that receives `DayHeaderInfo` and returns one.
* @see https://fullcalendar.io/docs/day-header-render-hooks
*/
dayHeaderInnerClass: refineClassNameGenerator,
/**
* Custom content for each `dayHeader` part, injected inside it in place of its default content.
* @see https://fullcalendar.io/docs/day-header-render-hooks
*/
dayHeaderContent: identity,
/**
* Called right after each `dayHeader` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/day-header-render-hooks
*/
dayHeaderDidMount: identity,
/**
* Called right before each `dayHeader` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/day-header-render-hooks
*/
dayHeaderWillUnmount: identity,
/**
* The horizontal alignment of day header text: `'start'`, `'center'`, or `'end'`, or a function of
* the header's `level`, `inPopover`, and `isNarrow` that returns one. Themes set their own default.
* @see https://fullcalendar.io/docs/day-header-render-hooks
*/
dayHeaderAlign: identity,
// stickiness for cell-inner-contents laterally. experimental settings
_dayHeaderSticky: identity,
/**
* Class names for the row of day headers above the grid. A string only; functions are not accepted.
* @see https://fullcalendar.io/docs/day-header-row-render-hooks
*/
dayHeaderRowClass: refineClassName,
/**
* Class names for the line between the day headers and the grid body. A string, or a function that
* receives `DayHeaderDividerInfo` and returns one.
* @see https://fullcalendar.io/docs/day-header-divider-render-hooks
*/
dayHeaderDividerClass: refineClassNameGenerator,
/**
* Class names for one horizontal row of day cells, usually a week. A string only; functions are not
* accepted.
* @see https://fullcalendar.io/docs/day-row-render-hooks
*/
dayRowClass: refineClassName,
/**
* Called right after each `dayCell` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/day-cell-render-hooks
*/
dayCellDidMount: identity,
/**
* Called right before each `dayCell` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/day-cell-render-hooks
*/
dayCellWillUnmount: identity,
/**
* Class names for one day's cell in a day grid, holding its date number and its events. Also the
* body of the "+more" popover. A string, or a function that receives `DayCellInfo` and returns one.
* @see https://fullcalendar.io/docs/day-cell-render-hooks
*/
dayCellClass: refineClassNameGenerator,
/**
* Class names for the middle of a day cell, where its events are stacked. A string, or a function
* that receives `DayCellInfo` and returns one.
* @see https://fullcalendar.io/docs/day-cell-render-hooks
*/
dayCellInnerClass: refineClassNameGenerator,
/**
* Custom content for each `dayCellTop` part, injected inside it in place of its default content.
* @see https://fullcalendar.io/docs/day-cell-render-hooks
*/
dayCellTopContent: identity,
/**
* Class names for the top of a day cell, where the date number appears. A string, or a function
* that receives `DayCellInfo` and returns one.
* @see https://fullcalendar.io/docs/day-cell-render-hooks
*/
dayCellTopClass: refineClassNameGenerator,
/**
* Class names for the date number inside a day cell's top; may be a nav link. A string, or a
* function that receives `DayCellInfo` and returns one.
* @see https://fullcalendar.io/docs/day-cell-render-hooks
*/
dayCellTopInnerClass: refineClassNameGenerator,
/**
* Class names for the bottom of a day cell, where the "+more" link would sit. A string, or a
* function that receives `DayCellInfo` and returns one.
* @see https://fullcalendar.io/docs/day-cell-render-hooks
*/
dayCellBottomClass: refineClassNameGenerator,
/**
* Whether TimeGrid views show the all-day section at the top. When `false`, all-day events are
* not displayed in those views.
* @see https://fullcalendar.io/docs/allDaySlot
*/
allDaySlot: Boolean,
/**
* The label for the all-day section of TimeGrid views, also used as the time text of all-day events
* in list views. Defined by the locale.
*/
allDayText: String,
/**
* Class names for the cell to the left of the all-day row, labeling it ("all-day"). A string, or a
* function that receives `AllDayHeaderInfo` and returns one.
* @see https://fullcalendar.io/docs/all-day-header-render-hooks
*/
allDayHeaderClass: refineClassNameGenerator,
/**
* Class names for the text wrapper inside the all-day header. A string, or a function that receives
* `AllDayHeaderInfo` and returns one.
* @see https://fullcalendar.io/docs/all-day-header-render-hooks
*/
allDayHeaderInnerClass: refineClassNameGenerator,
/**
* Custom content for each `allDayHeader` part, injected inside it in place of its default content.
* @see https://fullcalendar.io/docs/all-day-header-render-hooks
*/
allDayHeaderContent: identity,
/**
* Called right after each `allDayHeader` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/all-day-header-render-hooks
*/
allDayHeaderDidMount: identity,
/**
* Called right before each `allDayHeader` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/all-day-header-render-hooks
*/
allDayHeaderWillUnmount: identity,
/**
* A screen-reader label for the timed section of TimeGrid views. Defined by the locale.
*/
timedText: String,
/**
* The minimum width in pixels of each time slot in timeline views. If unset, a width is computed
* automatically.
* @see https://fullcalendar.io/docs/slotMinWidth
*/
slotMinWidth: Number,
/**
* The minimum height in pixels of each time slot in TimeGrid views. Slots are never shorter than
* their content requires.
* @see https://fullcalendar.io/docs/slotMinHeight
*/
slotMinHeight: Number,
/**
* Whether day names, dates, and week numbers become links that navigate to a day or week view. Use
* `navLinkDayClick` and `navLinkWeekClick` to customize the destination.
* @see https://fullcalendar.io/docs/navLinks
*/
navLinks: Boolean,
/**
* The date format of the time text shown on events, as a date formatter. Each view has its own
* default.
* @see https://fullcalendar.io/docs/eventTimeFormat
*/
eventTimeFormat: createFormatter,
/**
* How many milliseconds to wait after a change before rerendering, so that rapid successive changes
* are batched into one render. Off by default. Ignored by the React and Preact components, which
* rerender when their framework does.
* @see https://fullcalendar.io/docs/rerenderDelay
*/
rerenderDelay: Number, // TODO: move to vanilla right? nah keep here
/**
* The text after the count in "+more" links, such as "more" in "+2 more", or a function that
* receives the count and returns the full text. Defined by the locale.
*/
moreLinkText: identity, // this not enforced :( check others too
/**
* The accessible label for "+more" links. A string where `$0` is replaced by the number of hidden
* events, or a function that receives that number. Defined by the locale.
* @see https://fullcalendar.io/docs/hints
*/
moreLinkHint: identity,
/**
* How many pixels the mouse must move after pressing before a date selection begins. Useful for
* telling a selection apart from a `dateClick`.
* @see https://fullcalendar.io/docs/selectMinDistance
*/
selectMinDistance: Number,
/**
* Whether the user can select dates or time slots by clicking and dragging. Requires the
* interaction plugin.
* @see https://fullcalendar.io/docs/selectable
*/
selectable: Boolean,
/**
* On touch devices, how long in milliseconds the user must hold down before a date selection
* begins. Defaults to `longPressDelay`.
* @see https://fullcalendar.io/docs/selectLongPressDelay
*/
selectLongPressDelay: Number,
/**
* On touch devices, how long in milliseconds the user must hold down on an event before it can be
* dragged. Defaults to `longPressDelay`.
* @see https://fullcalendar.io/docs/eventLongPressDelay
*/
eventLongPressDelay: Number,
/**
* Whether to draw a placeholder event while the user drags to select time slots, instead of only
* highlighting them. Applies to TimeGrid views.
* @see https://fullcalendar.io/docs/selectMirror
*/
selectMirror: Boolean,
/**
* The maximum number of events stacked side by side in TimeGrid views, or top to bottom in timeline
* views, before the rest are collapsed into a "+more" link. Unlimited if unset.
* @see https://fullcalendar.io/docs/eventMaxStack
*/
eventMaxStack: Number,
/**
* The minimum height in pixels of events in TimeGrid views.
* @see https://fullcalendar.io/docs/eventMinHeight
*/
eventMinHeight: Number,
/**
* The minimum width in pixels of events in timeline views.
* @see https://fullcalendar.io/docs/eventMinWidth
*/
eventMinWidth: Number,
/**
* The height in pixels below which an event in a TimeGrid view gets its compact "short" layout.
* @see https://fullcalendar.io/docs/eventShortHeight
*/
eventShortHeight: Number,
/**
* Whether timed events in TimeGrid views may visually overlap one another. When `false`, they are
* placed fully side by side.
* @see https://fullcalendar.io/docs/slotEventOverlap
*/
slotEventOverlap: Boolean,
/**
* The day each week begins on, where Sunday is `0`, Monday is `1`, and so on. Defaults to the
* locale's first day, or Monday when `weekNumberCalculation` is `'ISO'`.
* @see https://fullcalendar.io/docs/firstDay
*/
firstDay: Number,
/**
* The number of visible days a view displays; days hidden by `weekends` or `hiddenDays` are
* skipped and not counted. Mainly used to define custom views.
* @see https://fullcalendar.io/docs/dayCount
*/
dayCount: Number,
/**
* The unit a custom view's start date is aligned to, such as `'week'` or `'month'`. If unset, it is
* derived from the view's duration; ignored when `visibleRange` is set.
* @see https://fullcalendar.io/docs/dateAlignment
*/
dateAlignment: String,
/**
* How far the calendar moves when navigating to the previous or next period, as a Duration.
* Defaults to the view's duration.
* @see https://fullcalendar.io/docs/dateIncrement
*/
dateIncrement: createDuration,
/**
* Days of the week to hide, as an array of numbers where Sunday is `0`, Monday is `1`, and so on.
* @see https://fullcalendar.io/docs/hiddenDays
*/
hiddenDays: identity,
/**
* Whether month views always display six weeks. If `false`, each month shows four, five, or six
* weeks, depending on how many it spans.
* @see https://fullcalendar.io/docs/fixedWeekCount
*/
fixedWeekCount: Boolean,
/**
* Limits which dates the user can navigate to and where events can be placed: an object with
* `start` and/or `end` dates, or a function that receives today's date and returns one. Dates
* outside the range are disabled.
* @see https://fullcalendar.io/docs/validRange
*/
validRange: identity, // `this` works?
/**
* The exact date range a view displays: an object with `start` and exclusive `end` dates, or a
* function that receives the calendar's current date (the one navigated to) and returns one.
* @see https://fullcalendar.io/docs/visibleRange
*/
visibleRange: identity, // `this` works?
/**
* The date format of the toolbar title, as a date formatter. Each view has its own default.
* @see https://fullcalendar.io/docs/titleFormat
*/
titleFormat: identity,
/**
* Whether events are focusable and keyboard-activatable. When unset, each event's own
* `interactive` property decides, falling back to whether an `eventClick` handler is defined.
* Events with a `url` are always interactive.
* @see https://fullcalendar.io/docs/eventInteractive
*/
eventInteractive: Boolean,
// only used by list-view, but languages define the value, so we need it in base options
/**
* The message list views display when there are no events in the date range. Defined by the locale.
* @see https://fullcalendar.io/docs/no-events-render-hooks
*/
noEventsText: String,
/**
* The accessible label for toolbar buttons that switch views. A string where `$0` is replaced by
* the button text, or a function that receives the button text and view name. Defined by the
* locale.
* @see https://fullcalendar.io/docs/hints
*/
viewHint: identity,
/**
* The accessible label for a toolbar button group made only of view buttons. Defined by the locale.
*/
viewChangeHint: String, // for the tab container
/**
* The accessible label for nav links. A string where `$0` is replaced by the formatted date, or a
* function that receives that text and the Date. Defined by the locale.
* @see https://fullcalendar.io/docs/hints
*/
navLinkHint: identity,
/**
* The accessible label for the close button of the "+more" event popover. Defined by the locale.
* @see https://fullcalendar.io/docs/hints
*/
closeHint: String,
/**
* The accessible label for a group of events, such as each day's events in list views and the
* events area of timeline views. Defined by the locale.
*/
eventsHint: String,
/**
* The heading level of the toolbar title, applied as `aria-level` (`2` makes it act like an
* `<h2>`), so it fits the page's heading hierarchy.
* @see https://fullcalendar.io/docs/headingLevel
*/
headingLevel: Number,
/**
* What happens when the user clicks a "+more" link: `'popover'` (the default), `'week'`, `'day'`, a
* view name, or a function that receives information about the hidden events and may return one of
* those values.
* @see https://fullcalendar.io/docs/moreLinkClick
*/
moreLinkClick: identity,
/**
* Custom content for each `moreLink` part, injected inside it in place of its default content.
* @see https://fullcalendar.io/docs/more-link-render-hooks
*/
moreLinkContent: identity,
/**
* Called right after each `moreLink` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/more-link-render-hooks
*/
moreLinkDidMount: identity,
/**
* Called right before each `moreLink` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/more-link-render-hooks
*/
moreLinkWillUnmount: identity,
/**
* Class names for a "+N more" link, shown when a day or slot has more events than fit. A string, or
* a function that receives `MoreLinkInfo` and returns one.
* @see https://fullcalendar.io/docs/more-link-render-hooks
*/
moreLinkClass: refineClassNameGenerator,
/**
* Class names for the text wrapper inside a "+N more" link. A string, or a function that receives
* `MoreLinkInfo` and returns one.
* @see https://fullcalendar.io/docs/more-link-render-hooks
*/
moreLinkInnerClass: refineClassNameGenerator,
//
/**
* Class names for a "+N more" link in a row layout: day cells and timeline rows. A string, or a
* function that receives `MoreLinkInfo` and returns one.
* @see https://fullcalendar.io/docs/row-more-link-render-hooks
*/
rowMoreLinkClass: refineClassNameGenerator,
/**
* Class names for the text wrapper inside a row "+N more" link. A string, or a function that
* receives `MoreLinkInfo` and returns one.
* @see https://fullcalendar.io/docs/row-more-link-render-hooks
*/
rowMoreLinkInnerClass: refineClassNameGenerator,
//
/**
* Class names for a "+N more" link in a day lane, when too many timed events overlap. A string, or
* a function that receives `MoreLinkInfo` and returns one.
* @see https://fullcalendar.io/docs/column-more-link-render-hooks
*/
columnMoreLinkClass: refineClassNameGenerator,
/**
* Class names for the text wrapper inside a column "+N more" link. A string, or a function that
* receives `MoreLinkInfo` and returns one.
* @see https://fullcalendar.io/docs/column-more-link-render-hooks
*/
columnMoreLinkInnerClass: refineClassNameGenerator,
/**
* Class names for a date or week number that navigates to that day or week when clicked (with the
* `navLinks` setting). A string only; functions are not accepted.
* @see https://fullcalendar.io/docs/navLinkClass
*/
navLinkClass: refineClassName,
/**
* The date format used instead of `dayCellFormat` for the view's first date and the first day of
* each month, when a DayGrid view spans more than one month.
* @see https://fullcalendar.io/docs/monthStartFormat
*/
monthStartFormat: createFormatter,
/**
* The date format of the day number in each DayGrid day cell.
* @see https://fullcalendar.io/docs/dayCellFormat
*/
dayCellFormat: createFormatter,
// for connectors
// (can't be part of plugin system b/c must be provided at runtime)
handleCustomRendering: identity,
customRenderingMetaMap: identity,
/**
* Class names for the popover listing every event of a day, opened by a "+N more" link. A string
* only; functions are not accepted.
* @see https://fullcalendar.io/docs/popover-render-hooks
*/
popoverClass: refineClassName,
/**
* Class names for the popover's close button. A string only; functions are not accepted.
* @see https://fullcalendar.io/docs/popover-render-hooks
*/
popoverCloseClass: refineClassName,
/**
* Content rendered inside the popover's close button (the `popoverClose` part), typically an icon.
* Empty unless a theme provides one.
* @see https://fullcalendar.io/docs/popover-render-hooks
*/
popoverCloseContent: identity,
/**
* The column width in pixels below which day columns switch to their narrow date text and layout.
* @see https://fullcalendar.io/docs/dayNarrowWidth
*/
dayNarrowWidth: Number,
/**
* Whether to remove the borders around the calendar's outer edge.
* @see https://fullcalendar.io/docs/borderless
*/
borderless: Boolean,
/**
* Whether to remove the calendar's left and right outer borders. Themes may also indent the
* toolbars to align with the calendar body.
* @see https://fullcalendar.io/docs/borderless
*/
borderlessX: Boolean,
/**
* Whether to remove the calendar's top outer border.
* @see https://fullcalendar.io/docs/borderless
*/
borderlessTop: Boolean,
/**
* Whether to remove the calendar's bottom outer border.
* @see https://fullcalendar.io/docs/borderless
*/
borderlessBottom: Boolean,
/**
* Class names for an empty spacer that keeps columns aligned, e.g. under resource rows that don't
* fill the height. A string, or a function of the part's info that returns one.
* @see https://fullcalendar.io/docs/filler-render-hooks
*/
fillerClass: refineClassNameGenerator,
/**
* Class names for the toolbar above the view. A string, or a function that receives `ToolbarInfo`
* and returns one.
* @see https://fullcalendar.io/docs/toolbar-render-hooks
*/
headerToolbarClass: refineClassNameGenerator,
/**
* Class names for the toolbar below the view. A string, or a function that receives `ToolbarInfo`
* and returns one.
* @see https://fullcalendar.io/docs/toolbar-render-hooks
*/
footerToolbarClass: refineClassNameGenerator,
/**
* Class names for a toolbar, header or footer, holding up to three sections (start, center, end). A
* string, or a function that receives `ToolbarInfo` and returns one.
* @see https://fullcalendar.io/docs/toolbar-render-hooks
*/
toolbarClass: refineClassNameGenerator,
/**
* Class names for one of a toolbar's start, center and end sections. A string, or a function that
* receives `ToolbarSectionInfo` and returns one.
* @see https://fullcalendar.io/docs/toolbar-render-hooks
*/
toolbarSectionClass: refineClassNameGenerator,
/**
* Class names for the title text in a toolbar, usually the current date range. A string only;
* functions are not accepted.
* @see https://fullcalendar.io/docs/toolbar-render-hooks
*/
toolbarTitleClass: refineClassName,
/**
* Class names for the grid layout of the view, with a header and a body. Shares the view element in
* grid and timeline views; in multi-month views, each month has its own. A string, or a function that
* receives `TableDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/table-render-hooks
*/
tableClass: refineClassNameGenerator,
/**
* Class names for the fixed header above the grid: day names, or times in timelines. A string, or a
* function that receives `TableHeaderInfo` and returns one.
* @see https://fullcalendar.io/docs/table-render-hooks
*/
tableHeaderClass: refineClassNameGenerator,
/**
* Class names for the scrolling body of the grid, where cells, lanes and events appear. A string,
* or a function that receives `TableBodyInfo` and returns one.
* @see https://fullcalendar.io/docs/table-render-hooks
*/
tableBodyClass: refineClassNameGenerator,
/**
* Class names for shading over times or days outside business hours. A string only; functions are
* not accepted.
* @see https://fullcalendar.io/docs/business-hours-render-hooks
*/
nonBusinessHoursClass: refineClassName,
/**
* Class names for the shaded area showing a date range the user is selecting. A string only;
* functions are not accepted.
* @see https://fullcalendar.io/docs/highlight-render-hooks
*/
highlightClass: refineClassName,
// daygrid-only
/**
* Whether to display the row of day headers at the top of DayGrid and TimeGrid views.
* @see https://fullcalendar.io/docs/dayHeaders
*/
dayHeaders: Boolean,
/**
* The date format of the day headers, as a date formatter. Each view has its own default.
* @see https://fullcalendar.io/docs/dayHeaderFormat
*/
dayHeaderFormat: createFormatter,
// timegrid-only
/**
* Class names for the line between the all-day row and the timed slots. A string only; functions
* are not accepted.
* @see https://fullcalendar.io/docs/all-day-divider-render-hooks
*/
allDayDividerClass: refineClassName,
// list-only
/**
* Class names for the container for all of a list view's day sections. A string only; functions are
* not accepted.
* @see https://fullcalendar.io/docs/list-day-render-hooks
*/
listDaysClass: refineClassName, // rename this?
/**
* Class names for one day's section in a list view: its heading and its events. A string, or a
* function that receives `ListDayInfo` and returns one.
* @see https://fullcalendar.io/docs/list-day-render-hooks
*/
listDayClass: refineClassNameGenerator,
//
/**
* The date format of the main text in each list view day header, or `false` to show none.
* @see https://fullcalendar.io/docs/listDayFormat
*/
listDayFormat: createFalsableFormatter, // defaults specified in list plugins
/**
* The date format of the secondary text in each list view day header, or `false` to show none.
* @see https://fullcalendar.io/docs/listDayAltFormat
*/
listDayAltFormat: createFalsableFormatter, // "
//
/**
* Called right after each `listDayHeader` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/list-day-header-render-hooks
*/
listDayHeaderDidMount: identity,
/**
* Called right before each `listDayHeader` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/list-day-header-render-hooks
*/
listDayHeaderWillUnmount: identity,
/**
* Class names for the date heading above a list view day's events. A string, or a function that
* receives `ListDayHeaderInfo` and returns one.
* @see https://fullcalendar.io/docs/list-day-header-render-hooks
*/
listDayHeaderClass: refineClassNameGenerator,
/**
* Class names for one of the two halves of a list view day heading (day name and date); may be a
* nav link. A string, or a function that receives `ListDayHeaderInnerInfo` and returns one.
* @see https://fullcalendar.io/docs/list-day-header-render-hooks
*/
listDayHeaderInnerClass: refineClassNameGenerator,
/**
* Custom content for each text element of a list view day header (the `listDayHeaderInner` parts,
* one each for `listDayFormat` and `listDayAltFormat`), in place of the formatted date.
* @see https://fullcalendar.io/docs/list-day-header-render-hooks
*/
listDayHeaderContent: identity,
//
/**
* Class names for the wrapper around one list view day's events. A string, or a function that
* receives `ListDayEventsInfo` and returns one.
* @see https://fullcalendar.io/docs/list-day-render-hooks
*/
listDayBodyClass: refineClassNameGenerator,
//
/**
* Class names for the "No events to display" message in an empty list view. A string, or a function
* that receives `NoEventsInfo` and returns one.
* @see https://fullcalendar.io/docs/no-events-render-hooks
*/
noEventsClass: refineClassNameGenerator,
/**
* Class names for the text wrapper inside the no-events message. A string, or a function that
* receives `NoEventsInfo` and returns one.
* @see https://fullcalendar.io/docs/no-events-render-hooks
*/
noEventsInnerClass: refineClassNameGenerator,
/**
* Custom content for each `noEvents` part, injected inside it in place of its default content.
* @see https://fullcalendar.io/docs/no-events-render-hooks
*/
noEventsContent: identity,
/**
* Called right after each `noEvents` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/no-events-render-hooks
*/
noEventsDidMount: identity,
/**
* Called right before each `noEvents` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/no-events-render-hooks
*/
noEventsWillUnmount: identity,
// noEventsText is defined in base options
// multimonth-only
/**
* The maximum number of months per row in multi-month views. Fewer are shown when each month would
* be narrower than `singleMonthMinWidth`.
* @see https://fullcalendar.io/docs/multiMonthMaxColumns
*/
multiMonthMaxColumns: Number,
//
/**
* The minimum width in pixels of each month in multi-month views. When months would be narrower,
* they wrap onto more rows.
* @see https://fullcalendar.io/docs/singleMonthMinWidth
*/
singleMonthMinWidth: Number,
/**
* The date format of the title above each month in multi-month views.
* @see https://fullcalendar.io/docs/singleMonthTitleFormat
*/
singleMonthTitleFormat: createFormatter,
/**
* Called right after each `singleMonth` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/single-month-render-hooks
*/
singleMonthDidMount: identity,
/**
* Called right before each `singleMonth` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/single-month-render-hooks
*/
singleMonthWillUnmount: identity,
/**
* Class names for one month's block in multi-month views, with its own header and grid. A string, or
* a function that receives `SingleMonthInfo` and returns one.
* @see https://fullcalendar.io/docs/single-month-render-hooks
*/
singleMonthClass: refineClassNameGenerator,
/**
* Class names for the month name above each month's grid ("January 2026"). A string, or a function
* that receives `SingleMonthHeaderInfo` and returns one.
* @see https://fullcalendar.io/docs/single-month-header-render-hooks
*/
singleMonthHeaderClass: refineClassNameGenerator,
/**
* Class names for the text wrapper inside a month header; may be a nav link. A string, or a
* function that receives `SingleMonthHeaderInfo` and returns one.
* @see https://fullcalendar.io/docs/single-month-header-render-hooks
*/
singleMonthHeaderInnerClass: refineClassNameGenerator,
};
// do NOT give a type here. need `typeof BASE_OPTION_DEFAULTS` to give real results.
// raw values.
const BASE_OPTION_DEFAULTS = {
buttonDisplay: 'auto',
eventDisplay: 'auto',
defaultTimedEventDuration: '01:00:00',
defaultAllDayEventDuration: { day: 1 },
forceEventDuration: false,
nextDayThreshold: '00:00:00',
initialView: '',
aspectRatio: 1.35,
weekends: true,
weekNumbers: false,
weekNumberCalculation: 'local',
editable: false,
nowIndicator: false,
scrollTime: '06:00:00',
scrollTimeReset: true,
slotMinTime: '00:00:00',
slotMaxTime: '24:00:00',
showNonCurrentDates: true,
lazyFetching: true,
startParam: 'start',
endParam: 'end',
timeZoneParam: 'timeZone',
timeZone: 'local', // TODO: throw error if given falsy value?
locales: [],
locale: '', // blank values means it will compute based off locales[]
dragRevertDuration: 500,
dragScroll: true,
allDayMaintainDuration: false,
unselectAuto: true,
dropAccept: '*',
eventOrder: 'start,-duration,allDay,title',
eventSlicing: true,
eventPrintLayout: 'auto',
popoverFormat: { month: 'long', day: 'numeric', year: 'numeric' },
longPressDelay: 1000,
eventDragMinDistance: 5, // only applies to mouse
expandRows: false,
navLinks: false,
selectable: false,
eventMinHeight: 15,
eventMinWidth: 30,
eventShortHeight: 30,
monthStartFormat: { month: 'long', day: 'numeric' },
dayCellFormat: { day: 'numeric', omitTrailing: true },
headingLevel: 2, // like H2
outerBorder: true,
dayNarrowWidth: 80,
eventOverlap: true,
slotHeaderAlign: 'start',
slotHeaderSticky: true,
dayHeaderAlign: 'start',
_dayHeaderSticky: true,
rowEventTitleSticky: true,
columnEventTitleSticky: true,
nowIndicatorSnap: 'auto',
// daygrid-only
dayHeaders: true,
};
// calendar listeners
// ------------------
const CALENDAR_LISTENER_REFINERS = {
/**
* Called after the calendar's date range is first set or changes, such as on navigation or a
* view switch, once the new dates have rendered.
* @see https://fullcalendar.io/docs/datesSet
*/
datesSet: identity,
/**
* Called after the calendar's events are first loaded or change in any way, with an array of every
* event in memory (the same as `getEvents()`).
* @see https://fullcalendar.io/docs/eventsSet
*/
eventsSet: identity,
/**
* Called after an event is added to the calendar, via `addEvent` or by dropping another calendar's
* event. Not called for external draggable elements (see `eventReceive`). The info includes
* `revert` to undo the addition.
* @see https://fullcalendar.io/docs/eventAdd
*/
eventAdd: identity,
/**
* Called after an event is modified, via its setter methods or by dragging or resizing. The info
* includes the updated event, the previous `oldEvent`, and `revert` to undo the change.
* @see https://fullcalendar.io/docs/eventChange
*/
eventChange: identity,
/**
* Called after an event is removed from the calendar, via `remove()` or by dragging it to another
* calendar. The info includes `revert` to undo the removal.
* @see https://fullcalendar.io/docs/eventRemove
*/
eventRemove: identity,
/**
* Called when the user clicks an event, with the event, its element, the native `jsEvent`, and
* the view. Call `info.jsEvent.preventDefault()` to stop the browser from following the event's `url`.
* @see https://fullcalendar.io/docs/eventClick
*/
eventClick: identity, // TODO: resource for scheduler????
/**
* Called when the pointer moves onto an event, with the event, its element, the native `jsEvent`,
* and the view.
* @see https://fullcalendar.io/docs/eventMouseEnter
*/
eventMouseEnter: identity,
/**
* Called when the pointer moves off an event, with the event, its element, the native `jsEvent`,
* and the view.
* @see https://fullcalendar.io/docs/eventMouseLeave
*/
eventMouseLeave: identity,
/**
* Called when a date or time range is selected, by the user (requires the interaction plugin and
* `selectable`) or via the `select()` method. The info includes the range's `start`, exclusive
* `end`, `allDay`, the native `jsEvent`, and the view.
* @see https://fullcalendar.io/docs/select-callback
*/
select: identity, // resource for scheduler????
/**
* Called when the current date selection is cleared, with an object holding the native `jsEvent`
* (if any) and the view.
* @see https://fullcalendar.io/docs/unselect-callback
*/
unselect: identity,
/**
* Called with `true` when the calendar starts fetching events (or resources, with premium resource
* plugins), and with `false` when all fetching is done.
* @see https://fullcalendar.io/docs/loading
*/
loading: identity,
// internal
_unmount: identity,
_beforeprint: identity,
_afterprint: identity,
_noDateSelect: identity,
_noEventDrop: identity,
_noEventResize: identity,
_timeScrollRequest: identity,
// interaction-plugin-only
/**
* Called when the user clicks a date or time slot. The info includes the clicked `date`, `allDay`,
* the element, the native `jsEvent`, and the view. Requires the interaction plugin.
* @see https://fullcalendar.io/docs/dateClick
*/
dateClick: identity,
/**
* Called when the user starts dragging an event, with the event, the native `jsEvent`, and the
* view.
* @see https://fullcalendar.io/docs/eventDragStart
*/
eventDragStart: identity,
/**
* Called when the user stops dragging an event, whether or not it moved, before the event is
* modified and before `eventDrop`.
* @see https://fullcalendar.io/docs/eventDragStop
*/
eventDragStop: identity,
/**
* Called when the user drops an event at a different date or time. The info includes the updated
* event, the previous `oldEvent`, the `delta`, and `revert` to undo the move.
* @see https://fullcalendar.io/docs/eventDrop
*/
eventDrop: identity,
/**
* Called when the user starts resizing an event, with the event, the native `jsEvent`, and the
* view.
* @see https://fullcalendar.io/docs/eventResizeStart
*/
eventResizeStart: identity,
/**
* Called when the user stops resizing an event, whether or not it changed, before the event is
* modified and before `eventResize`.
* @see https://fullcalendar.io/docs/eventResizeStop
*/
eventResizeStop: identity,
/**
* Called when the user resizes an event and its duration changes. The info includes the updated
* event, the previous `oldEvent`, the start and end deltas, and `revert` to undo the resize.
* @see https://fullcalendar.io/docs/eventResize
*/
eventResize: identity,
/**
* Called when an external draggable element, or another calendar's event, is dropped onto the
* calendar. Requires the interaction plugin.
* @see https://fullcalendar.io/docs/drop
*/
drop: identity,
/**
* Called when an external draggable element with event data, or another calendar's event, is
* dropped onto the calendar and becomes an event. The info includes `revert` to undo it.
* @see https://fullcalendar.io/docs/eventReceive
*/
eventReceive: identity,
/**
* Called when one of this calendar's events is dropped onto another calendar, just before it is
* removed from this one. The info includes `revert` to restore it.
* @see https://fullcalendar.io/docs/eventLeave
*/
eventLeave: identity,
};
// calendar-only options (not for view-specific)
// ---------------------------------------------
const CALENDAR_ONLY_OPTION_REFINERS = {
/**
* Class names for the calendar's root element. A string, or a function that receives
* `CalendarDisplayInfo` and returns one. Same as `className`.
* @see https://fullcalendar.io/docs/className
*/
class: refineClassNameGenerator,
/**
* Class names for the calendar's root element. A string, or a function that receives
* `CalendarDisplayInfo` and returns one. Same as `class`.
* @see https://fullcalendar.io/docs/className
*/
className: refineClassNameGenerator,
/**
* Class names for the view element: everything between the toolbars. A string, or a function that
* receives `ViewDisplayInfo` and returns one.
* @see https://fullcalendar.io/docs/view-render-hooks
*/
viewClass: refineClassNameGenerator,
/**
* Called right after each `view` part's element is added to the DOM.
* @see https://fullcalendar.io/docs/view-render-hooks
*/
viewDidMount: identity,
/**
* Called right before each `view` part's element is removed from the DOM.
* @see https://fullcalendar.io/docs/view-render-hooks
*/
viewWillUnmount: identity,
/**
* Per-view settings and custom view definitions, keyed by view name (such as `timeGridWeek`), view
* type (such as `timeGrid`), or duration unit (such as `week`, for every one-week view). A custom
* view entry sets `type` plus a duration, visible range, or day count.
* @see https://fullcalendar.io/docs/view-specific-options
*/
views: identity,
/**
* The plugins to load, such as the interaction plugin or premium view plugins.
* @see https://fullcalendar.io/docs/plugin-index
*/
plugins: identity,
/**
* Events to load when the calendar initializes, in any form `events` accepts. Unlike `events`,
* later changes to this value are ignored, so events can then be managed through the API.
* @see https://fullcalendar.io/docs/initialEvents
*/
initialEvents: identity,
/**
* The calendar's events: an array of event objects, a JSON feed URL, a function that supplies
* events, or an event source object.
* @see https://fullcalendar.io/docs/event-source
*/
events: identity,
/**
* Multiple event sources, each in any form `events` accepts: an array, a JSON feed URL, a function,
* or an event source object.
* @see https://fullcalendar.io/docs/eventSources
*/
eventSources: identity,
};
// view-specific options
// ---------------------
const VIEW_ONLY_OPTION_REFINERS = {
/**
* The existing view type that a custom view is based on, such as `'timeGrid'` or `'dayGrid'`. Used
* in a `views` entry along with a duration, visible range, or day count.
* @see https://fullcalendar.io/docs/custom-view-with-settings
*/
type: String,
/**
* A component that renders a custom view from scratch, written for the UI library of your
* FullCalendar package (for example React or Preact). Used in a `views` entry.
* @see https://fullcalendar.io/docs/custom-view-with-js
*/
component: identity,
/**
* In a `views` entry, class names for the view's root element. A string, or a function that
* receives `ViewDisplayInfo` and returns one. Same as `className`.
* @see https://fullcalendar.io/docs/custom-view-with-js
*/
class: refineClassNameGenerator,
/**
* In a `views` entry, class names for the view's root element. A string, or a function that
* receives `ViewDisplayInfo` and returns one. Same as `class`.
* @see https://fullcalendar.io/docs/custom-view-with-js
*/
className: refineClassNameGenerator,
/**
* In a `views` entry, renders a custom view from scratch: a content injection input, or a function
* that receives `ViewContentInfo` (including the view's dates and events) and returns one.
* @see https://fullcalendar.io/docs/custom-view-with-js
*/
content: identity,
/**
* In a `views` entry, called right after the view's element is added to the DOM.
* @see https://fullcalendar.io/docs/custom-view-with-js
*/
didMount: identity,
/**
* In a `views` entry, called right before the view's element is removed from the DOM.
* @see https://fullcalendar.io/docs/custom-view-with-js
*/
willUnmount: identity,
// internal only
buttonTextKey: String,
dateProfileGeneratorClass: identity,
usesMinMaxTime: Boolean,
disallowAmbigTitle: Boolean,
};
const COMPLEX_OPTION_COMPARATORS = {
// Unfortunately always need 'maybe' to handle undefined inital value, because of CalendarDataManager
dateIncrement: isMaybePropsEqualShallow,
headerToolbar: isMaybePropsEqualShallow,
footerToolbar: isMaybePropsEqualShallow,
buttons: isMaybePropsEqualDepth1,
plugins: isMaybeArraysEqual,
events: isMaybeArraysEqual,
eventSources: isMaybeArraysEqual,
['resources']: isMaybeArraysEqual,
// otherwise, an equal-but-new value, like from a React rerender, rebuilds the date profile (#7069)
validRange: isMaybeDateRangeInputsEqual,
visibleRange: isMaybeDateRangeInputsEqual,
hiddenDays: isMaybeArraysEqual,
};
// util funcs
// ----------------------------------------------------------------------------------------------------
function refineProps(input, refiners) {
let refined = {};
let extra = {};
for (let propName in refiners) {
if (propName in input) {
refined[propName] = refiners[propName](input[propName], propName);
}
}
for (let propName in input) {
if (!(propName in refiners)) {
extra[propName] = input[propName];
}
}
return { refined, extra };
}
function identity(raw) {
return raw;
}
/*
`false` refines to `null`, turning the formatted text off. A nullish input stays `undefined`, for the default.
*/
function createFalsableFormatter(input) {
if (input === false) {
return null;
}
return createFormatter(input) ?? undefined;
}
/*
The canonical way to construct an EventInstanceRange. Pass undefined for an edge's
instant when the input didn't express one or the edge's marker was derived civilly —
the property is omitted entirely (never stored as an undefined-valued key).
*/
function buildEventInstanceRange(start, end, instantStartMs, instantEndMs) {
const range = { start, end };
if (instantStartMs != null) {
range.instantStartMs = instantStartMs;
}
if (instantEndMs != null) {
range.instantEndMs = instantEndMs;
}
return range;
}
// Resolves an edge to its real instant, choosing the deterministic first occurrence when
// the marker is ambiguous and the edge does not carry an exact instant.
function resolveEdgeInstantMs(marker, instantMs, dateEnv) {
return instantMs ?? dateEnv.toDate(marker).valueOf();
}
/*
Builds every outward-facing representation of a range edge from one policy. Exact timed
edges use their true instant and its canonical wall-clock marker; civil/all-day edges keep
the supplied marker and DateEnv conversion.
*/
function buildRangeEdgeOutput(marker, instantMs, dateEnv, omitTime) {
const canonicalMarker = instantMs != null ? dateEnv.timestampToMarker(instantMs) : marker;
if (!omitTime && instantMs != null) {
// the offset of this exact instant. offsetForMarker can't tell the two copies of a repeated hour apart
const timeZoneOffset = Math.round((canonicalMarker.valueOf() - instantMs) / 60000);
return {
marker: canonicalMarker,
date: new Date(instantMs),
dateStr: buildIsoString(canonicalMarker, timeZoneOffset),
};
}
const date = dateEnv.toDate(marker);
// a nonexistent (DST-gap) wall-clock time resolves forward in `date`. the string names that same time
const resolvedMarker = omitTime ? marker : dateEnv.timestampToMarker(date.valueOf());
return {
marker: canonicalMarker,
date,
dateStr: dateEnv.formatIso(resolvedMarker, { omitTime }),
};
}
// the exact epoch instant of a range's start: the stored instant when present, otherwise
// deterministic first-occurrence resolution of the civil marker
function getRangeInstantStartMs(range, dateEnv) {
return resolveEdgeInstantMs(range.start, range.instantStartMs, dateEnv);
}
function getRangeInstantEndMs(range, dateEnv) {
return resolveEdgeInstantMs(range.end, range.instantEndMs, dateEnv);
}
// The canonical civil end: recomputed from the exact instant for fold-compressed ranges.
function canonicalRangeEndMarker(range, dateEnv) {
return range.instantEndMs != null ? dateEnv.timestampToMarker(range.instantEndMs) : range.end;
}
function rangeHasInstants(range) {
return range.instantStartMs != null || range.instantEndMs != null;
}
/*
Like rangesIntersect, but exact: when either range carries stored instants, real instants
are compared (a fold-compressed end's representational marker would otherwise falsely
collide with the other occurrence's civil times). Pure-civil pairs compare markers, as before.
*/
function instanceRangesIntersect(range0, range1, dateEnv) {
if (rangeHasInstants(range0) || rangeHasInstants(range1)) {
return getRangeInstantStartMs(range0, dateEnv) < getRangeInstantEndMs(range1, dateEnv) &&
getRangeInstantEndMs(range0, dateEnv) > getRangeInstantStartMs(range1, dateEnv);
}
return rangesIntersect(range0, range1);
}
/*
Like rangeContainsRange, but exact in the same way as instanceRangesIntersect.
The outer range may be open-ended.
*/
function instanceRangeContainsRange(outerRange, innerRange, dateEnv) {
if (rangeHasInstants(outerRange) || rangeHasInstants(innerRange)) {
const outerStartMs = outerRange.start != null ?
resolveEdgeInstantMs(outerRange.start, outerRange.instantStartMs, dateEnv) :
-Infinity;
const outerEndMs = outerRange.end != null ?
resolveEdgeInstantMs(outerRange.end, outerRange.instantEndMs, dateEnv) :
Infinity;
return outerStartMs <= getRangeInstantStartMs(innerRange, dateEnv) &&
outerEndMs >= getRangeInstantEndMs(innerRange, dateEnv);
}
return rangeContainsRange(outerRange, innerRange);
}
/*
Adds a positive duration to a start edge, deriving an END edge.
When the edge carries an exact instant and the duration is pure clock-time, the addition
happens in instant space (exact real elapsed time) and the result carries an instant too.
If a fall-back fold keeps the resulting canonical marker from advancing past the edge's own
marker, the result uses the edge's UTC-offset reading instead (the sanctioned
instant/marker disagreement — see EventInstanceRange). Calendar-unit durations and
instant-less edges use civil arithmetic (no instant).
*/
function addDurationToEdge(edge, duration, dateEnv) {
if (edge.instantMs != null && !duration.years && !duration.months && !duration.days) {
const durMs = asRoughMs(duration);
const instantMs = edge.instantMs + durMs;
const marker = dateEnv.timestampToMarker(instantMs);
return marker > edge.marker
? { marker, instantMs }
: { marker: addMs(edge.marker, durMs), instantMs };
}
return { marker: dateEnv.add(edge.marker, duration) };
}
/*
Builds a civilly-ordered EventInstanceRange from two edges, or null when the range is
invalid: pure-civil edges are invalid unless the end marker is after the start marker;
when either edge carries an exact instant, REAL-time order is the truth instead.
A real range that a DST fall-back fold civilly compresses (instants ordered, markers not)
is not discarded: its end marker is re-expressed in the start's UTC-offset reading
(start marker + real duration), keeping the exact end instant.
*/
function buildValidInstanceRange(start, end, dateEnv) {
if (start.instantMs == null && end.instantMs == null) {
return end.marker > start.marker
? buildEventInstanceRange(start.marker, end.marker)
: null;
}
const startMs = resolveEdgeInstantMs(start.marker, start.instantMs, dateEnv);
const endMs = resolveEdgeInstantMs(end.marker, end.instantMs, dateEnv);
if (endMs <= startMs) {
return null;
}
return buildEventInstanceRange(start.marker, end.marker > start.marker
? end.marker
: addMs(start.marker, endMs - startMs), // fold-compressed: start's offset reading
start.instantMs, end.instantMs);
}
function createEventInstance(defId, range) {
return {
instanceId: guid(),
defId,
range,
};
}
/* Date stuff that doesn't belong in datelib core
----------------------------------------------------------------------------------------------------------------------*/
// given a timed range, computes an all-day range that has the same exact duration,
// but whose start time is aligned with the start of the day.
function computeAlignedDayRange(timedRange) {
let dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;
let start = startOfDay(timedRange.start);
let end = addDays(start, dayCnt);
return { start, end };
}
// given a timed range, computes an all-day range based on how for the end date bleeds into the next day
// TODO: give nextDayThreshold a default arg
function computeVisibleDayRange(timedRange, nextDayThreshold = createDuration(0)) {
let startDay = null;
let endDay = null;
if (timedRange.end) {
endDay = startOfDay(timedRange.end);
let endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`
// If the end time is actually inclusively part of the next day and is equal to or
// beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.
// Otherwise, leaving it as inclusive will cause it to exclude `endDay`.
if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {
endDay = addDays(endDay, 1);
}
}
if (timedRange.start) {
startDay = startOfDay(timedRange.start); // the beginning of the day the range starts
// If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.
if (endDay && endDay <= startDay) {
endDay = addDays(startDay, 1);
}
}
return { start: startDay, end: endDay };
}
function diffDates(date0, date1, dateEnv, largeUnit) {
if (largeUnit === 'year') {
return createDuration(dateEnv.diffWholeYears(date0, date1), 'year');
}
if (largeUnit === 'month') {
return createDuration(dateEnv.diffWholeMonths(date0, date1), 'month');
}
return diffDayAndTime(date0, date1); // returns a duration
}
function parseRecurring(refined, defaultAllDay, dateEnv, recurringTypes) {
for (let i = 0; i < recurringTypes.length; i += 1) {
let parsed = recurringTypes[i].parse(refined, dateEnv);
if (parsed) {
let { allDay } = refined;
if (allDay == null) {
allDay = defaultAllDay;
if (allDay == null) {
allDay = parsed.allDayGuess;
if (allDay == null) {
allDay = false;
}
}
}
return {
allDay,
duration: parsed.duration,
typeData: parsed.typeData,
typeId: i,
};
}
}
return null;
}
function expandRecurring(eventStore, framingRange, context) {
let { dateEnv, pluginHooks, options } = context;
let { defs, instances } = eventStore;
// remove existing recurring instances
// TODO: bad. always expand events as a second step
instances = filterHash(instances, (instance) => !defs[instance.defId].recurringDef);
for (let defId in defs) {
let def = defs[defId];
if (def.recurringDef) {
let { duration } = def.recurringDef;
if (!duration) {
duration = def.allDay ?
options.defaultAllDayEventDuration :
options.defaultTimedEventDuration;
}
let starts = expandRecurringRanges(def, duration, framingRange, dateEnv, pluginHooks.recurringTypes);
for (let start of starts) {
let instance = createEventInstance(defId, {
start,
end: dateEnv.add(start, duration),
});
instances[instance.instanceId] = instance;
}
}
}
return { defs, instances };
}
/*
Event MUST have a recurringDef
*/
function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {
let typeDef = recurringTypes[eventDef.recurringDef.typeId];
let markers = typeDef.expand(eventDef.recurringDef.typeData, {
start: dateEnv.subtract(framingRange.start, duration), // for when event starts before framing range and goes into
end: framingRange.end,
}, dateEnv);
// the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to
if (eventDef.allDay) {
markers = markers.map(startOfDay);
}
return markers;
}
function parseEvents(rawEvents, eventSource, context, allowOpenRange, defIdMap, instanceIdMap) {
let eventStore = createEmptyEventStore();
let eventRefiners = buildEventRefiners(context);
for (let rawEvent of rawEvents) {
let tuple = parseEvent(rawEvent, eventSource, context, allowOpenRange, eventRefiners, defIdMap, instanceIdMap);
if (tuple) {
eventTupleToStore(tuple, eventStore);
}
}
return eventStore;
}
function eventTupleToStore(tuple, eventStore = createEmptyEventStore()) {
eventStore.defs[tuple.def.defId] = tuple.def;
if (tuple.instance) {
eventStore.instances[tuple.instance.instanceId] = tuple.instance;
}
return eventStore;
}
// retrieves events that have the same groupId as the instance specified by `instanceId`
// or they are the same as the instance.
// why might instanceId not be in the store? an event from another calendar?
function getRelevantEvents(eventStore, instanceId) {
let instance = eventStore.instances[instanceId];
if (instance) {
let def = eventStore.defs[instance.defId];
// get events/instances with same group
let newStore = filterEventStoreDefs(eventStore, (lookDef) => isEventDefsGrouped(def, lookDef));
// add the original
// TODO: wish we could use eventTupleToStore or something like it
newStore.defs[def.defId] = def;
newStore.instances[instance.instanceId] = instance;
return newStore;
}
return createEmptyEventStore();
}
function isEventDefsGrouped(def0, def1) {
return Boolean(def0.groupId && def0.groupId === def1.groupId);
}
function createEmptyEventStore() {
return { defs: {}, instances: {} };
}
function mergeEventStores(store0, store1) {
return {
defs: { ...store0.defs, ...store1.defs },
instances: { ...store0.instances, ...store1.instances },
};
}
function filterEventStoreDefs(eventStore, filterFunc) {
let defs = filterHash(eventStore.defs, filterFunc);
let instances = filterHash(eventStore.instances, (instance) => (defs[instance.defId] // still exists?
));
return { defs, instances };
}
function excludeSubEventStore(master, sub) {
let { defs, instances } = master;
let filteredDefs = {};
let filteredInstances = {};
for (let defId in defs) {
if (!sub.defs[defId]) { // not explicitly excluded
filteredDefs[defId] = defs[defId];
}
}
for (let instanceId in instances) {
if (!sub.instances[instanceId] && // not explicitly excluded
filteredDefs[instances[instanceId].defId] // def wasn't filtered away
) {
filteredInstances[instanceId] = instances[instanceId];
}
}
return {
defs: filteredDefs,
instances: filteredInstances,
};
}
function normalizeConstraint(input, context) {
if (Array.isArray(input)) {
return parseEvents(input, null, context, true); // allowOpenRange=true
}
if (typeof input === 'object' && input) { // non-null object
return parseEvents([input], null, context, true); // allowOpenRange=true
}
if (input != null) {
return String(input);
}
return null;
}
// TODO: better called "EventSettings" or "EventConfig"
// TODO: move this file into structs
// TODO: separate constraint/overlap/allow, because selection uses only that, not other props
const EVENT_UI_REFINERS = {
display: String,
editable: Boolean,
startEditable: Boolean,
durationEditable: Boolean,
constraint: identity, // Identity<ConstraintInput>, // circular reference. ts dies. event->constraint->event
overlap: identity,
allow: identity,
class: refineClassName,
className: refineClassName,
color: String,
contrastColor: String,
};
const EMPTY_EVENT_UI = {
display: null,
startEditable: null,
durationEditable: null,
constraints: [],
overlap: null,
allows: [],
color: '',
contrastColor: '',
className: '',
};
function createEventUi(refined, context) {
let constraint = normalizeConstraint(refined.constraint, context);
return {
display: refined.display || null,
startEditable: refined.startEditable != null ? refined.startEditable : refined.editable,
durationEditable: refined.durationEditable != null ? refined.durationEditable : refined.editable,
constraints: constraint != null ? [constraint] : [],
overlap: refined.overlap != null ? refined.overlap : null,
allows: refined.allow != null ? [refined.allow] : [],
color: refined.color || '',
contrastColor: refined.contrastColor || '',
className: (refined.class ?? refined.className) || '',
};
}
// TODO: prevent against problems with <2 args!
function combineEventUis(uis) {
return uis.reduce(combineTwoEventUis, EMPTY_EVENT_UI);
}
function combineTwoEventUis(item0, item1) {
return {
display: item1.display != null ? item1.display : item0.display,
startEditable: item1.startEditable != null ? item1.startEditable : item0.startEditable,
durationEditable: item1.durationEditable != null ? item1.durationEditable : item0.durationEditable,
constraints: item0.constraints.concat(item1.constraints),
overlap: typeof item1.overlap === 'boolean' ? item1.overlap : item0.overlap,
allows: item0.allows.concat(item1.allows),
color: item1.color || item0.color,
contrastColor: item1.contrastColor || item0.contrastColor,
className: joinClassNames(item0.className, item1.className),
};
}
const EMPTY_EVENT_UI_BASES = { base: EMPTY_EVENT_UI, bySource: {} };
const EVENT_NON_DATE_REFINERS = {
id: String,
groupId: String,
title: String,
url: String,
interactive: Boolean,
};
const EVENT_DATE_REFINERS = {
start: identity,
end: identity,
date: identity,
allDay: Boolean,
};
const EVENT_REFINERS = {
...EVENT_NON_DATE_REFINERS,
...EVENT_DATE_REFINERS,
extendedProps: identity,
};
function parseEvent(raw, eventSource, context, allowOpenRange, refiners = buildEventRefiners(context), defIdMap, instanceIdMap) {
let { refined, extra } = refineEventDef(raw, context, refiners);
let defaultAllDay = computeIsDefaultAllDay(eventSource, context);
let recurringRes = parseRecurring(refined, defaultAllDay, context.dateEnv, context.pluginHooks.recurringTypes);
if (recurringRes) {
let def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', recurringRes.allDay, Boolean(recurringRes.duration), context, defIdMap);
def.recurringDef = {
typeId: recurringRes.typeId,
typeData: recurringRes.typeData,
duration: recurringRes.duration,
};
return { def, instance: null };
}
let singleRes = parseSingle(refined, defaultAllDay, context, allowOpenRange);
if (singleRes) {
let def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', singleRes.allDay, singleRes.hasEnd, context, defIdMap);
let instance = createEventInstance(def.defId, singleRes.range);
if (instanceIdMap && def.publicId && instanceIdMap[def.publicId]) {
instance.instanceId = instanceIdMap[def.publicId];
}
return { def, instance };
}
return null;
}
function refineEventDef(raw, context, refiners = buildEventRefiners(context)) {
return refineProps(raw, refiners);
}
function buildEventRefiners(context) {
return { ...EVENT_UI_REFINERS, ...EVENT_REFINERS, ...context.pluginHooks.eventRefiners };
}
/*
Will NOT populate extendedProps with the leftover properties.
Will NOT populate date-related props.
*/
function parseEventDef(refined, extra, sourceId, allDay, hasEnd, context, defIdMap) {
let def = {
title: refined.title || '',
groupId: refined.groupId || '',
publicId: refined.id || '',
url: refined.url || '',
recurringDef: null,
defId: ((defIdMap && refined.id) ? defIdMap[refined.id] : '') || guid(),
sourceId,
allDay,
hasEnd,
interactive: refined.interactive,
ui: createEventUi(refined, context),
extendedProps: {
...(refined.extendedProps || {}),
...extra,
},
};
for (let memberAdder of context.pluginHooks.eventDefMemberAdders) {
Object.assign(def, memberAdder(refined));
}
// help out EventImpl from having user modify props
Object.freeze(def.ui.className); // might be simple string, but freeze still works
Object.freeze(def.extendedProps);
return def;
}
function parseSingle(refined, defaultAllDay, context, allowOpenRange) {
let { allDay } = refined;
let startMeta;
let startMarker = null;
let hasEnd = false;
let endMeta;
let endMarker = null;
let startInput = refined.start != null ? refined.start : refined.date;
startMeta = context.dateEnv.createMarkerMeta(startInput);
if (startMeta) {
startMarker = startMeta.marker;
}
else if (!allowOpenRange) {
return null;
}
if (refined.end != null) {
endMeta = context.dateEnv.createMarkerMeta(refined.end);
}
if (allDay == null) {
if (defaultAllDay != null) {
allDay = defaultAllDay;
}
else {
// fall back to the date props LAST
allDay = (!startMeta || startMeta.isTimeUnspecified) &&
(!endMeta || endMeta.isTimeUnspecified);
}
}
if (allDay && startMarker) {
startMarker = startOfDay(startMarker);
}
// exact instants are stamped when the input expressed them (ISO with offset, Date,
// epoch ms) and the marker was used as-is. allDay truncation invalidates instants.
let startInstantMs = (!allDay && startMeta) ? startMeta.instantMs : undefined;
let range = null;
if (endMeta) {
endMarker = allDay ? startOfDay(endMeta.marker) : endMeta.marker;
if (!startMarker) { // open start (allowOpenRange)
range = buildEventInstanceRange(startMarker, endMarker, undefined, allDay ? undefined : endMeta.instantMs);
}
else if (allDay) {
if (endMarker > startMarker) {
range = buildEventInstanceRange(startMarker, endMarker);
}
}
else {
// rejects ends invalid in real time; real ranges that a DST fall-back fold civilly
// compresses keep their exact end, re-expressed in the start's offset reading
range = buildValidInstanceRange({ marker: startMarker, instantMs: startInstantMs }, { marker: endMarker, instantMs: endMeta.instantMs }, context.dateEnv);
}
}
if (range) {
hasEnd = true;
}
else if (allowOpenRange) {
range = buildEventInstanceRange(startMarker, null, startInstantMs);
}
else {
hasEnd = context.options.forceEventDuration || false;
// exact starts get an exact derived end (real elapsed duration), so the end can't
// re-resolve to the wrong side of a DST fold
let endEdge = addDurationToEdge({ marker: startMarker, instantMs: startInstantMs }, allDay ?
context.options.defaultAllDayEventDuration :
context.options.defaultTimedEventDuration, context.dateEnv);
range = buildEventInstanceRange(startMarker, endEdge.marker, startInstantMs, endEdge.instantMs);
}
return { allDay, hasEnd, range };
}
function computeIsDefaultAllDay(eventSource, context) {
let res = null;
if (eventSource) {
res = eventSource.defaultAllDay;
}
if (res == null) {
res = context.options.defaultAllDay;
}
return res;
}
const STANDARD_PROPS = {
start: identity,
end: identity,
allDay: Boolean,
};
function parseDateSpan(raw, dateEnv, defaultDuration) {
let span = parseOpenDateSpan(raw, dateEnv);
if (!span) {
return null;
}
let { range } = span;
if (!range.start) {
return null;
}
if (!range.end) {
if (defaultDuration == null) {
return null;
}
const endEdge = addDurationToEdge({ marker: range.start, instantMs: span.instantStartMs }, defaultDuration, dateEnv);
range.end = endEdge.marker;
if (endEdge.instantMs != null) {
span.instantEndMs = endEdge.instantMs;
}
}
return span;
}
/*
TODO: somehow combine with parseRange?
Will return null if the start/end props were present but parsed invalidly.
*/
function parseOpenDateSpan(raw, dateEnv) {
let { refined: standardProps, extra } = refineProps(raw, STANDARD_PROPS);
let startMeta = standardProps.start ? dateEnv.createMarkerMeta(standardProps.start) : null;
let endMeta = standardProps.end ? dateEnv.createMarkerMeta(standardProps.end) : null;
let { allDay } = standardProps;
if (allDay == null) {
allDay = (startMeta && startMeta.isTimeUnspecified) &&
(!endMeta || endMeta.isTimeUnspecified);
}
let range = {
start: startMeta ? startMeta.marker : null,
end: endMeta ? endMeta.marker : null,
};
if (!allDay && startMeta && endMeta && (startMeta.instantMs != null || endMeta.instantMs != null)) {
const validRange = buildValidInstanceRange({ marker: startMeta.marker, instantMs: startMeta.instantMs }, { marker: endMeta.marker, instantMs: endMeta.instantMs }, dateEnv);
if (!validRange && startMeta.instantMs != null && endMeta.instantMs != null) {
return null;
}
if (validRange) {
range = { start: validRange.start, end: validRange.end };
}
}
const span = {
range,
allDay,
...extra,
};
if (allDay) {
delete span.instantStartMs;
delete span.instantEndMs;
}
else {
if (startMeta?.instantMs != null) {
span.instantStartMs = startMeta.instantMs;
}
if (endMeta?.instantMs != null) {
span.instantEndMs = endMeta.instantMs;
}
}
return span;
}
function isDateSpansEqual(span0, span1) {
return rangesEqual(span0.range, span1.range) &&
span0.allDay === span1.allDay &&
isSpanPropsEqual(span0, span1);
}
// the NON-DATE-RELATED props
function isSpanPropsEqual(span0, span1) {
for (let propName in span1) {
if (propName !== 'range' && propName !== 'allDay') {
if (span0[propName] !== span1[propName]) {
return false;
}
}
}
// are there any props that span0 has that span1 DOESN'T have?
// both have range/allDay, so no need to special-case.
for (let propName in span0) {
if (!(propName in span1)) {
return false;
}
}
return true;
}
function buildDateSpanApi(span, dateEnv) {
return {
...buildRangeApi(span.range, dateEnv, span.allDay, span),
allDay: span.allDay,
};
}
function buildRangeApiWithTimeZone(range, dateEnv, omitTime) {
return {
...buildRangeApi(range, dateEnv, omitTime),
timeZone: dateEnv.timeZone,
};
}
function buildRangeApi(range, dateEnv, omitTime, rangeMeta) {
// exact instants may ride on a span (rangeMeta) or on the range itself
const instantStartMs = rangeMeta?.instantStartMs ?? range.instantStartMs;
const instantEndMs = rangeMeta?.instantEndMs ?? range.instantEndMs;
const start = buildRangeEdgeOutput(range.start, instantStartMs, dateEnv, omitTime);
const end = buildRangeEdgeOutput(range.end, instantEndMs, dateEnv, omitTime);
return {
start: start.date,
end: end.date,
startStr: start.dateStr,
endStr: end.dateStr,
};
}
function getDateSpanInstantStartMs(dateSpan, dateEnv) {
return resolveEdgeInstantMs(dateSpan.range.start, dateSpan.instantStartMs, dateEnv);
}
function getDateSpanInstantEndMs(dateSpan, dateEnv) {
return resolveEdgeInstantMs(dateSpan.range.end, dateSpan.instantEndMs, dateEnv);
}
function fabricateEventRange(dateSpan, eventUiBases, context) {
let res = refineEventDef({ editable: false }, context);
let def = parseEventDef(res.refined, res.extra, '', // sourceId
dateSpan.allDay, true, // hasEnd
context);
return {
def,
ui: compileEventUi(def, eventUiBases),
instance: createEventInstance(def.defId, dateSpan.range),
range: dateSpan.range,
isStart: true,
isEnd: true,
};
}
function triggerDateSelect(selection, pev, context) {
context.emitter.trigger('select', {
...buildDateSpanApiWithContext(selection, context),
jsEvent: pev ? pev.origEvent : null, // Is this always a mouse event? See #4655
view: context.viewApi || context.calendarApi.view,
});
}
function triggerDateUnselect(pev, context) {
context.emitter.trigger('unselect', {
jsEvent: pev ? pev.origEvent : null, // Is this always a mouse event? See #4655
view: context.viewApi || context.calendarApi.view,
});
}
function buildDateSpanApiWithContext(dateSpan, context) {
let props = {};
for (let transform of context.pluginHooks.dateSpanTransforms) {
Object.assign(props, transform(dateSpan, context));
}
Object.assign(props, buildDateSpanApi(dateSpan, context.dateEnv));
return props;
}
// Given an event's allDay status and start date, return what its fallback end date should be.
// TODO: rename to computeDefaultEventEnd
function getDefaultEventEnd(allDay, marker, context) {
let { dateEnv, options } = context;
let end = marker;
if (allDay) {
end = startOfDay(end);
end = dateEnv.add(end, options.defaultAllDayEventDuration);
}
else {
end = dateEnv.add(end, options.defaultTimedEventDuration);
}
return end;
}
// like getDefaultEventEnd, but edge-based: an exact start yields an exact derived end
// (real elapsed duration), so the end can't re-resolve to the wrong side of a DST fold
function getDefaultEventEndEdge(allDay, start, context) {
if (allDay) {
return { marker: getDefaultEventEnd(true, start.marker, context) };
}
return addDurationToEdge(start, context.options.defaultTimedEventDuration, context.dateEnv);
}
// applies the mutation to ALL defs/instances within the event store
function applyMutationToEventStore(eventStore, eventConfigBase, mutation, context) {
let eventConfigs = compileEventUis(eventStore.defs, eventConfigBase);
let dest = createEmptyEventStore();
for (let defId in eventStore.defs) {
let def = eventStore.defs[defId];
dest.defs[defId] = applyMutationToEventDef(def, eventConfigs[defId], mutation, context);
}
for (let instanceId in eventStore.instances) {
let instance = eventStore.instances[instanceId];
let def = dest.defs[instance.defId]; // important to grab the newly modified def
dest.instances[instanceId] = applyMutationToEventInstance(instance, def, eventConfigs[instance.defId], mutation, context);
}
return dest;
}
function applyMutationToEventDef(eventDef, eventConfig, mutation, context) {
let standardProps = mutation.standardProps || {};
// if hasEnd has not been specified, guess a good value based on deltas.
// if duration will change, there's no way the default duration will persist,
// and thus, we need to mark the event as having a real end
if (standardProps.hasEnd == null &&
eventConfig.durationEditable &&
(mutation.startDelta || mutation.endDelta)) {
standardProps.hasEnd = true; // TODO: is this mutation okay?
}
let copy = {
...eventDef,
...standardProps,
ui: { ...eventDef.ui, ...standardProps.ui }, // the only prop we want to recursively overlay
};
if (mutation.extendedProps) {
copy.extendedProps = { ...copy.extendedProps, ...mutation.extendedProps };
}
for (let applier of context.pluginHooks.eventDefMutationAppliers) {
applier(copy, mutation, context);
}
if (!copy.hasEnd && context.options.forceEventDuration) {
copy.hasEnd = true;
}
return copy;
}
function applyMutationToEventInstance(eventInstance, eventDef, // must first be modified by applyMutationToEventDef
eventConfig, mutation, context) {
let forceAllDay = mutation.standardProps && mutation.standardProps.allDay === true;
let clearEnd = mutation.standardProps && mutation.standardProps.hasEnd === false;
let copy = { ...eventInstance };
if (forceAllDay) {
copy.range = computeAlignedDayRange(copy.range); // fresh plain range: instants stripped
}
if (mutation.datesDelta && eventConfig.startEditable) {
copy.range = buildInstanceRange(addDeltaToRangeEdge(copy.range.start, copy.range.instantStartMs, mutation.datesDelta, mutation.instantDatesDeltaMs, context), addDeltaToRangeEdge(copy.range.end, copy.range.instantEndMs, mutation.datesDelta, mutation.instantDatesDeltaMs, context));
}
if (mutation.startDelta && eventConfig.durationEditable) {
copy.range = buildInstanceRange(addDeltaToRangeEdge(copy.range.start, copy.range.instantStartMs, mutation.startDelta, mutation.instantStartDeltaMs, context), { marker: copy.range.end, instantMs: copy.range.instantEndMs });
}
if (mutation.endDelta && eventConfig.durationEditable) {
copy.range = buildInstanceRange({ marker: copy.range.start, instantMs: copy.range.instantStartMs }, addDeltaToRangeEdge(copy.range.end, copy.range.instantEndMs, mutation.endDelta, mutation.instantEndDeltaMs, context));
}
if (clearEnd) {
const startEdge = { marker: copy.range.start, instantMs: copy.range.instantStartMs };
copy.range = buildInstanceRange(startEdge, getDefaultEventEndEdge(eventDef.allDay, startEdge, context));
}
// in case event was all-day but the supplied deltas were not
// better util for this?
if (eventDef.allDay) {
copy.range = {
start: startOfDay(copy.range.start),
end: startOfDay(copy.range.end),
};
}
// handle invalid durations. a timed range can be invalid civilly or in real time.
// a real range that a DST fall-back fold civilly compresses is re-expressed (end in the
// start's offset reading) rather than repaired away
if (eventDef.allDay) {
if (copy.range.end <= copy.range.start) {
const startEdge = { marker: copy.range.start };
copy.range = buildInstanceRange(startEdge, getDefaultEventEndEdge(true, startEdge, context));
}
}
else {
const startEdge = { marker: copy.range.start, instantMs: copy.range.instantStartMs };
copy.range = buildValidInstanceRange(startEdge, { marker: copy.range.end, instantMs: copy.range.instantEndMs }, context.dateEnv) ?? buildInstanceRange(startEdge, getDefaultEventEndEdge(false, startEdge, context));
}
return copy;
}
/*
When instantDeltaMs is given, moves the edge by an exact instant amount, basing off the
edge's stored instant when present (preserves identity through DST fall-back doubled times).
The resulting marker is always a real local time in the current timeZone; ambiguous civil
times resolve deterministically. Civil (Duration-only) deltas invalidate any stored instant.
*/
function addDeltaToRangeEdge(marker, instantMs, delta, instantDeltaMs, context) {
if (instantDeltaMs != null) {
const newInstantMs = resolveEdgeInstantMs(marker, instantMs, context.dateEnv) + instantDeltaMs;
return {
marker: context.dateEnv.timestampToMarker(newInstantMs),
instantMs: newInstantMs,
};
}
// civil deltas apply to the edge's canonical civil form — a fold-compressed end's
// stored marker is representational and must not enter civil arithmetic
return {
marker: context.dateEnv.add(instantMs != null ? context.dateEnv.timestampToMarker(instantMs) : marker, delta),
};
}
function buildInstanceRange(start, end) {
return buildEventInstanceRange(start.marker, end.marker, start.instantMs, end.instantMs);
}
class EventSourceImpl {
constructor(context, internalEventSource) {
this.context = context;
this.internalEventSource = internalEventSource;
}
remove() {
this.context.dispatch({
type: 'REMOVE_EVENT_SOURCE',
sourceId: this.internalEventSource.sourceId,
});
}
refetch() {
this.context.dispatch({
type: 'FETCH_EVENT_SOURCES',
sourceIds: [this.internalEventSource.sourceId],
isRefetch: true,
});
}
get id() {
return this.internalEventSource.publicId;
}
get url() {
return this.internalEventSource.meta.url;
}
get format() {
return this.internalEventSource.meta.format; // TODO: bad. not guaranteed
}
}
class EventImpl {
// instance will be null if expressing a recurring event that has no current instances,
// OR if trying to validate an incoming external event that has no dates assigned
constructor(context, def, instance) {
this._context = context;
this._def = def;
this._instance = instance || null;
}
/*
TODO: make event struct more responsible for this
*/
setProp(name, val) {
if (name in EVENT_DATE_REFINERS) {
warn(`Cannot set date-related event property \`${name}\`. Use a method instead.`);
// TODO: make proper aliasing system?
}
else if (name === 'id') {
val = EVENT_NON_DATE_REFINERS[name](val);
this.mutate({
standardProps: { publicId: val }, // hardcoded internal name
});
}
else if (name in EVENT_NON_DATE_REFINERS) {
val = EVENT_NON_DATE_REFINERS[name](val);
this.mutate({
standardProps: { [name]: val },
});
}
else if (name in EVENT_UI_REFINERS) {
let ui = EVENT_UI_REFINERS[name](val);
if (name === 'editable') {
ui = { startEditable: val, durationEditable: val };
}
else {
ui = { [name]: val };
}
this.mutate({
standardProps: { ui },
});
}
else {
warn(`Cannot set event property \`${name}\`. Use setExtendedProp instead.`);
}
}
setExtendedProp(name, val) {
this.mutate({
extendedProps: { [name]: val },
});
}
setStart(startInput, options = {}) {
let { dateEnv } = this._context;
let startMeta = dateEnv.createMarkerMeta(startInput);
if (startMeta && this._instance) { // TODO: warning if parsed bad
let instanceRange = this._instance.range;
let startDelta = diffDates(instanceRange.start, startMeta.marker, dateEnv, options.granularity); // what if parsed bad!?
let instantDeltaMs = computeInstantDeltaMs(startMeta, getRangeInstantStartMs(instanceRange, dateEnv), options.granularity);
if (options.maintainDuration) {
this.mutate({ datesDelta: startDelta, instantDatesDeltaMs: instantDeltaMs });
}
else {
this.mutate({ startDelta, instantStartDeltaMs: instantDeltaMs });
}
}
}
setEnd(endInput, options = {}) {
let { dateEnv } = this._context;
let endMeta = null;
if (endInput != null) {
endMeta = dateEnv.createMarkerMeta(endInput);
if (!endMeta) {
return; // TODO: warning if parsed bad
}
}
if (this._instance) {
if (endMeta) {
let instanceRange = this._instance.range;
// canonical base: matches what a civil delta will be applied to
let endDelta = diffDates(canonicalRangeEndMarker(instanceRange, dateEnv), endMeta.marker, dateEnv, options.granularity);
let instantDeltaMs = computeInstantDeltaMs(endMeta, getRangeInstantEndMs(instanceRange, dateEnv), options.granularity);
this.mutate({ endDelta, instantEndDeltaMs: instantDeltaMs });
}
else {
this.mutate({ standardProps: { hasEnd: false } });
}
}
}
setDates(startInput, endInput, options = {}) {
let { dateEnv } = this._context;
let standardProps = { allDay: options.allDay };
let startMeta = dateEnv.createMarkerMeta(startInput);
let endMeta = null;
if (!startMeta) {
return; // TODO: warning if parsed bad
}
if (endInput != null) {
endMeta = dateEnv.createMarkerMeta(endInput);
if (!endMeta) { // TODO: warning if parsed bad
return;
}
}
if (this._instance) {
let instanceRange = this._instance.range;
// converting to all-day is civil-only: exact instants don't survive day-alignment
let skipInstants = options.allDay === true;
let instantStartDeltaMs = skipInstants ? undefined : computeInstantDeltaMs(startMeta, getRangeInstantStartMs(instanceRange, dateEnv), options.granularity);
let instantEndDeltaMs = (skipInstants || !endMeta) ? undefined : computeInstantDeltaMs(endMeta, getRangeInstantEndMs(instanceRange, dateEnv), options.granularity);
// when computing the diff for an event being converted to all-day,
// compute diff off of the all-day values the way event-mutation does.
if (options.allDay === true) {
instanceRange = computeAlignedDayRange(instanceRange);
}
// canonical bases: match what civil deltas will be applied to
let startDelta = diffDates(instanceRange.start, startMeta.marker, dateEnv, options.granularity);
if (endMeta) {
let endDelta = diffDates(canonicalRangeEndMarker(instanceRange, dateEnv), endMeta.marker, dateEnv, options.granularity);
if (durationsEqual(startDelta, endDelta) && instantStartDeltaMs === instantEndDeltaMs) {
this.mutate({ datesDelta: startDelta, instantDatesDeltaMs: instantStartDeltaMs, standardProps });
}
else {
this.mutate({ startDelta, endDelta, instantStartDeltaMs, instantEndDeltaMs, standardProps });
}
}
else { // means "clear the end"
standardProps.hasEnd = false;
this.mutate({ datesDelta: startDelta, instantDatesDeltaMs: instantStartDeltaMs, standardProps });
}
}
}
moveStart(deltaInput) {
let delta = createDuration(deltaInput);
if (delta) { // TODO: warning if parsed bad
this.mutate({ startDelta: delta });
}
}
moveEnd(deltaInput) {
let delta = createDuration(deltaInput);
if (delta) { // TODO: warning if parsed bad
this.mutate({ endDelta: delta });
}
}
moveDates(deltaInput) {
let delta = createDuration(deltaInput);
if (delta) { // TODO: warning if parsed bad
this.mutate({ datesDelta: delta });
}
}
setAllDay(allDay, options = {}) {
let standardProps = { allDay };
let { maintainDuration } = options;
if (maintainDuration == null) {
maintainDuration = this._context.options.allDayMaintainDuration;
}
if (this._def.allDay !== allDay) {
standardProps.hasEnd = maintainDuration;
}
this.mutate({ standardProps });
}
formatRange(formatInput) {
let { dateEnv } = this._context;
let instance = this._instance;
let formatter = createFormatter(formatInput);
let start = buildRangeEdgeOutput(instance.range.start, instance.range.instantStartMs, dateEnv);
if (this._def.hasEnd) {
let end = buildRangeEdgeOutput(instance.range.end, instance.range.instantEndMs, dateEnv);
return joinDateTimeFormatParts(dateEnv.formatRangeToParts(start.marker, end.marker, formatter, {
startInstantMs: start.date.valueOf(),
endInstantMs: end.date.valueOf(),
}));
}
return joinDateTimeFormatParts(dateEnv.formatToParts(start.marker, formatter, {
instantMs: start.date.valueOf(),
}));
}
mutate(mutation) {
let instance = this._instance;
if (instance) {
let def = this._def;
let context = this._context;
let { eventStore } = context.getCurrentData();
let relevantEvents = getRelevantEvents(eventStore, instance.instanceId);
let eventConfigBase = {
base: {
display: '',
startEditable: true,
durationEditable: true,
constraints: [],
overlap: null,
allows: [],
color: '',
contrastColor: '',
className: '',
},
bySource: {}, // a source's editable:false mustn't block the API
};
relevantEvents = applyMutationToEventStore(relevantEvents, eventConfigBase, mutation, context);
let oldEvent = new EventImpl(context, def, instance); // snapshot
this._def = relevantEvents.defs[def.defId];
this._instance = relevantEvents.instances[instance.instanceId];
context.dispatch({
type: 'MERGE_EVENTS',
eventStore: relevantEvents,
});
context.emitter.trigger('eventChange', {
oldEvent,
event: this,
relatedEvents: buildEventApis(relevantEvents, context, instance),
revert() {
context.dispatch({
type: 'RESET_EVENTS',
eventStore, // the ORIGINAL store
});
},
});
}
}
remove() {
let context = this._context;
let asStore = eventApiToStore(this);
context.dispatch({
type: 'REMOVE_EVENTS',
eventStore: asStore,
});
context.emitter.trigger('eventRemove', {
event: this,
relatedEvents: [],
revert() {
context.dispatch({
type: 'MERGE_EVENTS',
eventStore: asStore,
});
},
});
}
get source() {
let { sourceId } = this._def;
if (sourceId) {
return new EventSourceImpl(this._context, this._context.getCurrentData().eventSources[sourceId]);
}
return null;
}
get start() {
let instance = this._instance;
if (instance) {
return buildRangeEdgeOutput(instance.range.start, instance.range.instantStartMs, this._context.dateEnv, this._def.allDay).date;
}
return null;
}
get end() {
let instance = this._instance;
if (instance && this._def.hasEnd) {
return buildRangeEdgeOutput(instance.range.end, instance.range.instantEndMs, this._context.dateEnv, this._def.allDay).date;
}
return null;
}
get startStr() {
let instance = this._instance;
if (instance) {
return buildRangeEdgeOutput(instance.range.start, instance.range.instantStartMs, this._context.dateEnv, this._def.allDay).dateStr;
}
return '';
}
get endStr() {
let instance = this._instance;
if (instance && this._def.hasEnd) {
return buildRangeEdgeOutput(instance.range.end, instance.range.instantEndMs, this._context.dateEnv, this._def.allDay).dateStr;
}
return '';
}
// computable props that all access the def
// TODO: find a TypeScript-compatible way to do this at scale
get id() { return this._def.publicId; }
get groupId() { return this._def.groupId; }
get allDay() { return this._def.allDay; }
get title() { return this._def.title; }
get url() { return this._def.url; }
get display() { return this._def.ui.display || 'auto'; } // bad. just normalize the type earlier
get startEditable() { return this._def.ui.startEditable; }
get durationEditable() { return this._def.ui.durationEditable; }
get constraint() { return this._def.ui.constraints[0] || null; }
get overlap() { return this._def.ui.overlap; }
get allow() { return this._def.ui.allows[0] || null; }
get color() { return this._def.ui.color; }
get contrastColor() { return this._def.ui.contrastColor; }
// NOTE: user can't modify these because Object.freeze was called in event-def parsing
get className() { return this._def.ui.className; }
get extendedProps() { return this._def.extendedProps; }
toPlainObject(settings = {}) {
let def = this._def;
let { ui } = def;
let { startStr, endStr } = this;
let res = {
allDay: def.allDay,
};
if (def.title) {
res.title = def.title;
}
if (startStr) {
res.start = startStr;
}
if (endStr) {
res.end = endStr;
}
if (def.publicId) {
res.id = def.publicId;
}
if (def.groupId) {
res.groupId = def.groupId;
}
if (def.url) {
res.url = def.url;
}
if (ui.display && ui.display !== 'auto') {
res.display = ui.display;
}
// TODO: what about recurring-event properties???
// TODO: include startEditable/durationEditable/constraint/overlap/allow
if (ui.color) {
res.color = ui.color;
}
if (ui.contrastColor) {
res.contrastColor = ui.contrastColor;
}
if (ui.className) {
res.className = ui.className;
}
if (Object.keys(def.extendedProps).length) {
if (settings.collapseExtendedProps) {
Object.assign(res, def.extendedProps);
}
else {
res.extendedProps = def.extendedProps;
}
}
return res;
}
toJSON() {
return this.toPlainObject();
}
}
/*
The exact-ms counterpart of a civil delta, present when the input expressed an exact
instant (ISO with offset, Date, epoch ms). Undefined means the mutation applies only the
civil delta. Skipped when a granularity is requested (whole-unit semantics).
*/
function computeInstantDeltaMs(meta, fromInstantMs, granularity) {
return (meta.instantMs != null && !granularity)
? meta.instantMs - fromInstantMs
: undefined;
}
function eventApiToStore(eventApi) {
let def = eventApi._def;
let instance = eventApi._instance;
return {
defs: { [def.defId]: def },
instances: instance
? { [instance.instanceId]: instance }
: {},
};
}
function buildEventApis(eventStore, context, excludeInstance) {
let { defs, instances } = eventStore;
let eventApis = [];
let excludeInstanceId = excludeInstance ? excludeInstance.instanceId : '';
for (let id in instances) {
let instance = instances[id];
let def = defs[instance.defId];
if (instance.instanceId !== excludeInstanceId) {
eventApis.push(new EventImpl(context, def, instance));
}
}
return eventApis;
}
/*
Specifying nextDayThreshold signals that all-day ranges should be sliced.
*/
function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {
let inverseBgByGroupId = {};
let inverseBgByDefId = {};
let defByGroupId = {};
let bgRanges = [];
let fgRanges = [];
let eventUis = compileEventUis(eventStore.defs, eventUiBases);
for (let defId in eventStore.defs) {
let def = eventStore.defs[defId];
let ui = eventUis[def.defId];
if (ui.display === 'inverse-background') {
if (def.groupId) {
inverseBgByGroupId[def.groupId] = [];
if (!defByGroupId[def.groupId]) {
defByGroupId[def.groupId] = def;
}
}
else {
inverseBgByDefId[defId] = [];
}
}
}
for (let instanceId in eventStore.instances) {
let instance = eventStore.instances[instanceId];
let def = eventStore.defs[instance.defId];
let ui = eventUis[def.defId];
let origRange = instance.range;
let normalRange = (!def.allDay && nextDayThreshold) ?
computeVisibleDayRange(origRange, nextDayThreshold) :
origRange;
let slicedRange = intersectRanges(normalRange, framingRange);
if (slicedRange) {
if (ui.display === 'inverse-background') {
if (def.groupId) {
inverseBgByGroupId[def.groupId].push(slicedRange);
}
else {
inverseBgByDefId[instance.defId].push(slicedRange);
}
}
else if (ui.display !== 'none') {
(ui.display === 'background' ? bgRanges : fgRanges).push({
def,
ui,
instance,
range: buildSlicedEventRange(origRange, normalRange, slicedRange),
isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),
isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf(),
});
}
}
}
for (let groupId in inverseBgByGroupId) { // BY GROUP
let ranges = inverseBgByGroupId[groupId];
let invertedRanges = invertRanges(ranges, framingRange);
for (let invertedRange of invertedRanges) {
let def = defByGroupId[groupId];
let ui = eventUis[def.defId];
bgRanges.push({
def,
ui,
instance: null,
range: invertedRange,
isStart: false,
isEnd: false,
});
}
}
for (let defId in inverseBgByDefId) {
let ranges = inverseBgByDefId[defId];
let invertedRanges = invertRanges(ranges, framingRange);
for (let invertedRange of invertedRanges) {
bgRanges.push({
def: eventStore.defs[defId],
ui: eventUis[defId],
instance: null,
range: invertedRange,
isStart: false,
isEnd: false,
});
}
}
return { bg: bgRanges, fg: fgRanges };
}
/*
Carries instant fields from the original event range onto the sliced range, per-edge, only
for edges that were not clipped by the framing range. Only applies when the range was not
day-normalized (normalRange === origRange, i.e. timed events not subject to nextDayThreshold).
*/
function buildSlicedEventRange(origRange, normalRange, slicedRange) {
if (normalRange !== origRange) {
return slicedRange;
}
return buildEventInstanceRange(slicedRange.start, slicedRange.end, slicedRange.start.valueOf() === origRange.start.valueOf() ? origRange.instantStartMs : undefined, slicedRange.end.valueOf() === origRange.end.valueOf() ? origRange.instantEndMs : undefined);
}
function hasBgRendering(def) {
return def.ui.display === 'background' || def.ui.display === 'inverse-background';
}
function setElEventRange(el, eventRange) {
el.fcEventRange = eventRange;
}
function getElEventRange(el) {
return el.fcEventRange ||
el.parentNode.fcEventRange || // for the harness
null;
}
// event ui computation
function compileEventUis(eventDefs, eventUiBases) {
return mapHash(eventDefs, (eventDef) => compileEventUi(eventDef, eventUiBases));
}
/*
I wish we didn't need to deal with inheritance of all properties all together
I wish you could resolve just eventDisplay first, then the others
Lowest to highest. A resource's UI comes in as sectionUi in resource views, below the source's, but as
getExtraUi in views without resources, above it. The documented order puts it above the source everywhere;
this keeps the existing behavior until a release that can change it.
*/
function compileEventUi(eventDef, eventUiBases) {
const uis = [eventUiBases.base];
const sourceUi = eventUiBases.bySource[eventDef.sourceId];
const extraUi = eventUiBases.getExtraUi?.(eventDef);
if (eventUiBases.sectionUi) {
uis.push(eventUiBases.sectionUi);
}
if (sourceUi) {
uis.push(sourceUi);
}
if (extraUi) {
uis.push(extraUi);
}
uis.push(eventDef.ui);
return combineEventUis(uis);
}
function sortEventSegs(segs, eventOrderSpecs) {
let objs = segs.map(buildSegCompareObj);
objs.sort((obj0, obj1) => compareByFieldSpecs(obj0, obj1, eventOrderSpecs)); // !!!
return objs.map((c) => c._seg);
}
// returns a object with all primitive props that can be compared
function buildSegCompareObj(seg) {
let { eventRange } = seg;
let eventDef = eventRange.def;
let range = eventRange.instance ? eventRange.instance.range : eventRange.range;
let start = range.start ? range.start.valueOf() : 0; // TODO: better support for open-range events
let end = range.end ? range.end.valueOf() : 0; // "
return {
...eventDef.extendedProps,
...eventDef,
id: eventDef.publicId,
start,
end,
duration: end - start,
allDay: Number(eventDef.allDay),
_seg: seg, // for later retrieval
};
}
function computeEventRangeDraggable(eventRange, context) {
let { pluginHooks } = context;
let transformers = pluginHooks.isDraggableTransformers;
let { def, ui } = eventRange;
let val = ui.startEditable;
for (let transformer of transformers) {
val = transformer(val, def, ui, context);
}
return val;
}
/*
slicedStart/slicedEnd are optionally supplied to signal where breaks occur in view-specific segment
a better approach is to always slice with dates and always supply this argument,
however, daygrid only slices by row/col
*/
function buildEventRangeTimeText(timeFormat, eventRange, // timed/whole-day span
slicedStart, // view-sliced timed/whole-day span
slicedEnd, // view-sliced timed/whole-day span
isStart, isEnd, context, defaultDisplayEventTime = true, defaultDisplayEventEnd = true) {
const { dateEnv, options } = context;
const { def } = eventRange;
const { range } = eventRange.instance;
const canonicalStart = buildRangeEdgeOutput(range.start, range.instantStartMs, dateEnv);
const canonicalEnd = buildRangeEdgeOutput(range.end, range.instantEndMs, dateEnv);
let { displayEventTime, displayEventEnd } = options;
if (displayEventTime == null) {
displayEventTime = defaultDisplayEventTime !== false;
}
if (displayEventEnd == null) {
displayEventEnd = defaultDisplayEventEnd !== false;
}
const startDate = (!isStart &&
slicedStart &&
// if seg is the first seg, but start-date cut-off by slotMinTime, (technically isStart=false)
// we still want to display the original start-time
startOfDay(slicedStart).valueOf() !== startOfDay(canonicalStart.marker).valueOf())
? slicedStart
: canonicalStart.marker;
const endDate = (!isEnd &&
slicedEnd &&
// See above HACK, but for end-time
startOfDay(addMs(slicedEnd, -1)).valueOf() !== startOfDay(addMs(canonicalEnd.marker, -1)).valueOf())
? slicedEnd
: canonicalEnd.marker;
const startInstantMs = startDate === canonicalStart.marker ? canonicalStart.date.valueOf() : undefined;
const endInstantMs = endDate === canonicalEnd.marker ? canonicalEnd.date.valueOf() : undefined;
if (displayEventTime && !def.allDay) {
if (displayEventEnd && (isStart || isEnd) && def.hasEnd) {
// TODO: put this functionality in @full-ui/headless-calendar ?
const rangeParts = dateEnv.formatRangeToParts(startDate, endDate, timeFormat, {
startInstantMs,
endInstantMs,
});
const multiDaySeparator = detectMultiDayTimes(rangeParts);
// NOTE: produces strings like '12:00pm - 1:00pm', without condensing dayPeriod,
// but that's okay since it's technically a different dayPeriod on a different day
if (multiDaySeparator != null) {
return joinDateTimeFormatParts(dateEnv.formatToParts(startDate, timeFormat, {
instantMs: startInstantMs,
})) +
multiDaySeparator +
joinDateTimeFormatParts(dateEnv.formatToParts(endDate, timeFormat, {
instantMs: endInstantMs,
}));
}
return joinDateTimeFormatParts(rangeParts);
}
if (isStart) {
return joinDateTimeFormatParts(dateEnv.formatToParts(startDate, timeFormat, {
instantMs: startInstantMs,
}));
}
}
return '';
}
const dateUnits = new Set(['year', 'month', 'day']); // TODO: DRY
function detectMultiDayTimes(parts) {
let sharedPart;
let hasDatePart = false;
for (const part of parts) {
if (part.source === 'shared') {
sharedPart = part;
}
if (dateUnits.has(part.type)) {
hasDatePart = true;
}
}
return hasDatePart ? sharedPart.value : undefined;
}
function getEventRangeMeta(eventRange, todayRange, nowDate, nowMs) {
let segRange = eventRange.range;
return {
isPast: segRange.instantEndMs != null && nowMs != null
? segRange.instantEndMs <= nowMs
: segRange.end <= (nowDate || todayRange.start),
isFuture: segRange.instantStartMs != null && nowMs != null
? segRange.instantStartMs >= nowMs
: segRange.start >= (nowDate || todayRange.end),
isToday: todayRange && rangeContainsMarker(todayRange, segRange.start),
};
}
function buildEventRangeKey(eventRange) {
return eventRange.instance
? eventRange.instance.instanceId
: `${eventRange.def.defId}:${eventRange.range.start.toISOString()}`;
// inverse-background events don't have specific instances. TODO: better solution
}
function getEventTagAndAttrs(eventRange, context) {
let { def, instance } = eventRange;
let { url } = def;
if (url) {
return ['a', { href: url }, true];
}
let { emitter, options } = context;
let { eventInteractive } = options;
if (eventInteractive == null) {
eventInteractive = def.interactive;
if (eventInteractive == null) {
eventInteractive = Boolean(emitter.hasHandlers('eventClick'));
}
}
let attrs;
// mock what happens in EventClicking
if (eventInteractive) {
// only attach keyboard-related handlers because click handler is already done in EventClicking
attrs = createAriaKeyboardAttrs((ev) => {
emitter.trigger('eventClick', {
el: ev.target,
event: new EventImpl(context, def, instance),
jsEvent: ev,
view: context.viewApi,
});
});
attrs = { role: 'button', ...attrs };
}
return ['div', attrs, eventInteractive];
}
export { getRangeInstantEndMs as $, formatWithOrdinals as A, BASE_OPTION_DEFAULTS as B, CALENDAR_LISTENER_REFINERS as C, getElEventRange as D, EVENT_UI_REFINERS as E, listenBySelector as F, listenToHoverBySelector as G, isArraysEqual as H, isPropsEqualShallow as I, computeViewBorderless as J, isPropsEqualWithMap as K, createAriaClickAttrs as L, setElEventRange as M, buildEventRangeTimeText as N, getEventTagAndAttrs as O, computeEventRangeDraggable as P, refineClassName as Q, mergeMaybePropsDepth1 as R, getUnequalProps as S, computeVisibleDayRange as T, filterEventStoreDefs as U, VIEW_ONLY_OPTION_REFINERS as V, excludeSubEventStore as W, expandRecurring as X, mergeEventStores as Y, buildValidInstanceRange as Z, buildEventInstanceRange as _, buildEventApis as a, getRangeInstantStartMs as a0, enableCursor as a1, disableCursor as a2, getDateSpanInstantStartMs as a3, getDateSpanInstantEndMs as a4, compareNumbers as a5, getRelevantEvents as a6, applyMutationToEventStore as a7, addDeltaToRangeEdge as a8, preventSelection as a9, parseEventDef as aA, addDurationToEdge as aB, getDefaultEventEndEdge as aC, createEventInstance as aD, preventContextMenu as aa, allowSelection as ab, allowContextMenu as ac, isDateSpansEqual as ad, buildRangeEdgeOutput as ae, diffDates as af, whenTransitionDone as ag, sortEventSegs as ah, getEventRangeMeta as ai, compileEventUis as aj, instanceRangesIntersect as ak, buildDateSpanApiWithContext as al, instanceRangeContainsRange as am, EMPTY_EVENT_UI_BASES as an, fabricateEventRange as ao, flatArray as ap, buildEventRangeKey as aq, flatMapArray as ar, combineEventUis as as, hasBgRendering as at, compareByFieldSpecs as au, flexibleCompare as av, parseFieldSpecs as aw, refineClassNameGenerator as ax, removeExact as ay, refineEventDef as az, buildRangeApiWithTimeZone as b, createEventUi as c, arrayToHash as d, createFormatter as e, filterHash as f, guid as g, hashValuesToArray as h, identity as i, createEmptyEventStore as j, BASE_OPTION_REFINERS as k, CALENDAR_ONLY_OPTION_REFINERS as l, COMPLEX_OPTION_COMPARATORS as m, mapHash as n, parseDateSpan as o, parseEvents as p, triggerDateUnselect as q, refineProps as r, sliceEventStore as s, triggerDateSelect as t, EventImpl as u, eventTupleToStore as v, warn as w, EventSourceImpl as x, parseEvent as y, eventApiToStore as z };