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

Method constructor

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

Source from the content-addressed store, hash-verified

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

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