dhtmlx-scheduler 7.0.4 → 7.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1825,23 +1825,24 @@ class at {
1825
1825
  _renderDayGrid(h) {
1826
1826
  const { date: a, currentRange: r, eventDates: d, minWeeks: i } = this.getState();
1827
1827
  let _ = r[0], o = r[1];
1828
- const t = d.reduce((p, y) => (p[this.scheduler.date.day_start(new Date(y)).valueOf()] = !0, p), {}), n = document.createElement("div");
1828
+ const t = d.reduce((y, w) => (y[this.scheduler.date.day_start(new Date(w)).valueOf()] = !0, y), {}), n = document.createElement("div");
1829
1829
  this._renderDayGridHeader(n), h.appendChild(n);
1830
1830
  const s = this.scheduler, c = s.date.week_start(s.date.month_start(new Date(a))), u = s.date.month_start(new Date(a)), v = s.date.add(s.date.month_start(new Date(a)), 1, "month");
1831
1831
  let m = s.date.add(s.date.month_start(new Date(a)), 1, "month");
1832
+ const l = s.date.date_part(s._currentDate());
1832
1833
  m.getDay() !== 0 && (m = s.date.add(s.date.week_start(m), 1, "week"));
1833
- let l = this._weeksBetween(c, m);
1834
- i && l < i && (m = s.date.add(m, i - l, "week"));
1835
- let f = c;
1836
- const g = document.createElement("div");
1837
- for (g.classList.add("dhx_cal_datepicker_days"), this._domEvents.attach(g, "click", (p) => {
1838
- const y = p.target.closest("[data-cell-date]"), w = new Date(y.getAttribute("data-cell-date"));
1839
- this.callEvent("onDateClick", [w, p]);
1840
- }); f.valueOf() < m.valueOf(); ) {
1841
- const p = document.createElement("div");
1842
- p.setAttribute("data-cell-date", s.templates.format_date(f)), p.setAttribute("data-day", f.getDay()), p.innerHTML = f.getDate(), f.valueOf() < u.valueOf() ? p.classList.add("dhx_before") : f.valueOf() >= v.valueOf() && p.classList.add("dhx_after"), f.getDay() !== 0 && f.getDay() !== 6 || p.classList.add("dhx_cal_datepicker_weekend"), _ && o && f.valueOf() >= _.valueOf() && f.valueOf() < o.valueOf() && p.classList.add("dhx_cal_datepicker_current"), t[f.valueOf()] && p.classList.add("dhx_cal_datepicker_event"), p.classList.add("dhx_cal_datepicker_date"), g.appendChild(p), f = s.date.add(f, 1, "day");
1843
- }
1844
- h.appendChild(g);
1834
+ let f = this._weeksBetween(c, m);
1835
+ i && f < i && (m = s.date.add(m, i - f, "week"));
1836
+ let g = c;
1837
+ const p = document.createElement("div");
1838
+ for (p.classList.add("dhx_cal_datepicker_days"), this._domEvents.attach(p, "click", (y) => {
1839
+ const w = y.target.closest("[data-cell-date]"), b = new Date(w.getAttribute("data-cell-date"));
1840
+ this.callEvent("onDateClick", [b, y]);
1841
+ }); g.valueOf() < m.valueOf(); ) {
1842
+ const y = document.createElement("div");
1843
+ y.setAttribute("data-cell-date", s.templates.format_date(g)), y.setAttribute("data-day", g.getDay()), y.innerHTML = g.getDate(), g.valueOf() < u.valueOf() ? y.classList.add("dhx_before") : g.valueOf() >= v.valueOf() && y.classList.add("dhx_after"), g.getDay() !== 0 && g.getDay() !== 6 || y.classList.add("dhx_cal_datepicker_weekend"), g.valueOf() == l.valueOf() && y.classList.add("dhx_now"), _ && o && g.valueOf() >= _.valueOf() && g.valueOf() < o.valueOf() && y.classList.add("dhx_cal_datepicker_current"), t[g.valueOf()] && y.classList.add("dhx_cal_datepicker_event"), y.classList.add("dhx_cal_datepicker_date"), p.appendChild(y), g = s.date.add(g, 1, "day");
1844
+ }
1845
+ h.appendChild(p);
1845
1846
  }
1846
1847
  _renderMonthGrid(h) {
1847
1848
  const { date: a } = this.getState(), r = document.createElement("div");
@@ -1886,7 +1887,7 @@ class at {
1886
1887
  }
1887
1888
  }
1888
1889
  function nt(e) {
1889
- const h = { version: "7.0.4" };
1890
+ const h = { version: "7.0.5" };
1890
1891
  (function(t) {
1891
1892
  var n = { agenda: "https://docs.dhtmlx.com/scheduler/agenda_view.html", grid: "https://docs.dhtmlx.com/scheduler/grid_view.html", map: "https://docs.dhtmlx.com/scheduler/map_view.html", unit: "https://docs.dhtmlx.com/scheduler/units_view.html", timeline: "https://docs.dhtmlx.com/scheduler/timeline_view.html", week_agenda: "https://docs.dhtmlx.com/scheduler/weekagenda_view.html", year: "https://docs.dhtmlx.com/scheduler/year_view.html", anythingElse: "https://docs.dhtmlx.com/scheduler/views.html" }, s = { agenda: "ext/dhtmlxscheduler_agenda_view.js", grid: "ext/dhtmlxscheduler_grid_view.js", map: "ext/dhtmlxscheduler_map_view.js", unit: "ext/dhtmlxscheduler_units.js", timeline: "ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js", week_agenda: "ext/dhtmlxscheduler_week_agenda.js", year: "ext/dhtmlxscheduler_year_view.js", limit: "ext/dhtmlxscheduler_limit.js" };
1892
1893
  t._commonErrorMessages = { unknownView: function(c) {
@@ -3209,7 +3210,7 @@ https://docs.dhtmlx.com/scheduler/minicalendar.html`);
3209
3210
  s = s || m;
3210
3211
  var l = this._calc_event_y(n, t.xy.min_event_height), f = l.top, g = l.height, p = n._count || 1, y = n._sorder || 0;
3211
3212
  c = c || m.clientWidth, this.config.day_column_padding && (c -= this.config.day_column_padding);
3212
- var w = Math.floor((c - v) / p), b = y * w + (y > 0 ? 2 : 1);
3213
+ var w = Math.floor((c - v) / p), b = y * w + 1;
3213
3214
  if (n._inner || (w *= p - y), this.config.cascade_event_display) {
3214
3215
  var k = this.config.cascade_event_count, E = this.config.cascade_event_margin;
3215
3216
  b = y % k * E;
@@ -3249,7 +3250,7 @@ https://docs.dhtmlx.com/scheduler/minicalendar.html`);
3249
3250
  b.drag_id == n.id && (w += " dhx_cal_event_drag"), b.select_id == n.id && (w += " dhx_cal_event_selected");
3250
3251
  var k = t.templates.event_class(n.start_date, n.end_date, n);
3251
3252
  k && (w = w + " " + k), this.config.cascade_event_display && (w += " dhx_cal_event_cascade");
3252
- var E = u, D = '<div event_id="' + y + '" ' + this.config.event_attribute + '="' + y + '" class="' + w + '" style="position:absolute; top:' + c + "px; " + (this.config.rtl ? "right:" : "left:") + s + "px; width:" + E + "px; height:" + v + "px;" + (m || "") + '"></div>';
3253
+ var E = u - 1, D = '<div event_id="' + y + '" ' + this.config.event_attribute + '="' + y + '" class="' + w + '" style="position:absolute; top:' + c + "px; " + (this.config.rtl ? "right:" : "left:") + s + "px; width:" + E + "px; height:" + v + "px;" + (m || "") + '"></div>';
3253
3254
  p.innerHTML = D;
3254
3255
  var x = p.cloneNode(!0).firstChild;
3255
3256
  if (!g && t.renderEvent(x, n, u, v, l, f))