MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / constructor

Method constructor

codebase/sources/dhtmlxscheduler.js:8986–9002  ·  view source on GitHub ↗
(scheduler2, container, state = {})

Source from the content-addressed store, hash-verified

8984 }
8985 class DatePicker {
8986 constructor(scheduler2, container, state = {}) {
8987 this.state = { date: /* @__PURE__ */ new Date(), modes: ["days", "months", "years"], currentRange: [], eventDates: [], filterDays: null, currentModeIndex: 0, ...state };
8988 this.container = null;
8989 this.element = null;
8990 this.onStateChangeHandlers = [];
8991 this.scheduler = scheduler2;
8992 this._domEvents = scheduler2._createDomEventScope();
8993 this.state = this.getState();
8994 makeEventable(this);
8995 if (container) {
8996 this.container = container;
8997 this.render(this.container);
8998 }
8999 this.onStateChange((oldState, newState) => {
9000 this.callEvent("onStateChange", [newState, oldState]);
9001 });
9002 }
9003 getState() {
9004 return { ...this.state, mode: this.state.modes[this.state.currentModeIndex] };
9005 }

Callers

nothing calls this directly

Calls 5

getStateMethod · 0.95
renderMethod · 0.95
onStateChangeMethod · 0.95
makeEventableFunction · 0.70
callEventMethod · 0.65

Tested by

no test coverage detected