| 2965 | this.setState({ currentModeIndex: i }); |
| 2966 | } |
| 2967 | _renderCalendarHeader(i) { |
| 2968 | const { mode: t, date: n } = this.getState(), s = document.createElement("div"); |
| 2969 | s.classList.add("dhx_cal_datepicker_header"); |
| 2970 | const a = document.createElement("button"); |
| 2971 | a.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_left"), s.appendChild(a); |
| 2972 | const o = document.createElement("div"); |
| 2973 | if (o.classList.add("dhx_cal_datepicker_title"), t === "days") |
| 2974 | o.innerText = n.toLocaleString("default", { month: "long" }) + " " + n.getFullYear(); |
| 2975 | else if (t === "months") |
| 2976 | o.innerText = n.getFullYear(); |
| 2977 | else { |
| 2978 | const r = 10 * Math.floor(n.getFullYear() / 10); |
| 2979 | o.innerText = `${r} - ${r + 9}`; |
| 2980 | } |
| 2981 | this._domEvents.attach(o, "click", this._toggleMode.bind(this)), s.appendChild(o); |
| 2982 | const _ = document.createElement("button"); |
| 2983 | _.classList.add("dhx_cal_datepicker_arrow", "scheduler_icon", "arrow_right"), s.appendChild(_), i.appendChild(s), this._domEvents.attach(a, "click", this._adjustDate.bind(this, -1)), this._domEvents.attach(_, "click", this._adjustDate.bind(this, 1)); |
| 2984 | } |
| 2985 | render(i) { |
| 2986 | this._domEvents.detachAll(), this.container = i || this.container, this.container.innerHTML = "", this.element || (this.element = document.createElement("div"), this.element.classList.add("dhx_cal_datepicker")), this.element.innerHTML = "", this.container.appendChild(this.element), this._renderCalendarHeader(this.element); |
| 2987 | const t = document.createElement("div"); |