dhtmlx-scheduler 7.2.4 → 7.2.6

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.
@@ -3,7 +3,7 @@
3
3
  })(this, function(exports2) {
4
4
  "use strict";/** @license
5
5
 
6
- dhtmlxScheduler v.7.2.4 Standard
6
+ dhtmlxScheduler v.7.2.6 Standard
7
7
 
8
8
  To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product), please obtain Commercial/Enterprise or Ultimate license on our site https://dhtmlx.com/docs/products/dhtmlxScheduler/#licensing or contact us at sales@dhtmlx.com
9
9
 
@@ -2734,8 +2734,17 @@ To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product),
2734
2734
  start = this._drag_start;
2735
2735
  }
2736
2736
  } else {
2737
- if (end <= start)
2738
- end = start + timeStep * 6e4;
2737
+ if (end <= start) {
2738
+ if (obj && obj.round_position) {
2739
+ if (obj.x_unit == "hour" || obj.x_unit == "minute") {
2740
+ end = scheduler2.date.add(start, obj.x_step, obj.x_unit);
2741
+ } else {
2742
+ end = scheduler2.date.add(scheduler2.date.date_part(new Date(start)), 1, obj.x_unit);
2743
+ }
2744
+ } else {
2745
+ end = start + timeStep * 6e4;
2746
+ }
2747
+ }
2739
2748
  }
2740
2749
  }
2741
2750
  var new_end = new Date(end - 1);
@@ -3332,8 +3341,8 @@ To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product),
3332
3341
  scheduler2._render_month_scale = function(div, dd, sd, rows) {
3333
3342
  var ed = scheduler2.date.add(dd, 1, "month"), view_start = new Date(sd);
3334
3343
  var cd = scheduler2._currentDate();
3335
- this.date.date_part(cd);
3336
- this.date.date_part(sd);
3344
+ cd = this.date.date_part(cd);
3345
+ sd = this.date.date_part(sd);
3337
3346
  rows = rows || Math.ceil(Math.round((ed.valueOf() - sd.valueOf()) / (60 * 60 * 24 * 1e3)) / 7);
3338
3347
  var tdwidths = [];
3339
3348
  for (var i = 0; i <= 7; i++) {
@@ -3418,9 +3427,7 @@ To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product),
3418
3427
  };
3419
3428
  scheduler2._reset_month_scale = function(b, dd, sd, rows) {
3420
3429
  var ed = scheduler2.date.add(dd, 1, "month");
3421
- var cd = scheduler2._currentDate();
3422
- this.date.date_part(cd);
3423
- this.date.date_part(sd);
3430
+ sd = this.date.date_part(sd);
3424
3431
  rows = rows || Math.ceil(Math.round((ed.valueOf() - sd.valueOf()) / (60 * 60 * 24 * 1e3)) / 7);
3425
3432
  var height = Math.floor(b.clientHeight / rows) - this.xy.month_head_height;
3426
3433
  this._colsS.height = height + this.xy.month_head_height;
@@ -4856,7 +4863,7 @@ To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product),
4856
4863
  if (typeof ev.end_date == "string")
4857
4864
  ev.end_date = this.templates.api_date(ev.end_date);
4858
4865
  var d = (this.config.event_duration || this.config.time_step) * 6e4;
4859
- if (ev.start_date.valueOf() == ev.end_date.valueOf())
4866
+ if (new Date(ev.end_date).valueOf() - new Date(ev.start_date).valueOf() <= d)
4860
4867
  ev.end_date.setTime(ev.end_date.valueOf() + d);
4861
4868
  ev.start_date.setMilliseconds(0);
4862
4869
  ev.end_date.setMilliseconds(0);
@@ -6881,6 +6888,37 @@ To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product),
6881
6888
  break;
6882
6889
  }
6883
6890
  });
6891
+ function getDaysInMonth(year, month) {
6892
+ return new Date(year, month + 1, 0).getDate();
6893
+ }
6894
+ scheduler2.event(lightbox, "click", function(e) {
6895
+ if (e.target.closest(".dhx_lightbox_day_select") || e.target.closest(".dhx_lightbox_month_select")) {
6896
+ const monthSelectNodes = lightbox.querySelectorAll(".dhx_lightbox_month_select");
6897
+ const daySelectNodes = lightbox.querySelectorAll(".dhx_lightbox_day_select");
6898
+ const yearSelectNodes = lightbox.querySelectorAll(".dhx_lightbox_year_select");
6899
+ if (monthSelectNodes.length && daySelectNodes.length && yearSelectNodes) {
6900
+ monthSelectNodes.forEach((select, i) => {
6901
+ const daySelect = daySelectNodes[i];
6902
+ const month = parseInt(select.value, 10);
6903
+ let year = parseInt(yearSelectNodes[i].value, 10);
6904
+ if (!year) {
6905
+ year = new Date(scheduler2.getState().date).getFullYear();
6906
+ }
6907
+ const daysInMonth = getDaysInMonth(year, month);
6908
+ const maxDays = daysInMonth || 31;
6909
+ let curDayValue = daySelect.value;
6910
+ daySelect.innerHTML = "";
6911
+ for (let day = 1; day <= maxDays; day++) {
6912
+ const option = document.createElement("option");
6913
+ option.value = day;
6914
+ option.textContent = day;
6915
+ daySelect.appendChild(option);
6916
+ }
6917
+ daySelect.value = Math.min(curDayValue, maxDays);
6918
+ });
6919
+ }
6920
+ }
6921
+ });
6884
6922
  };
6885
6923
  scheduler2.setLightboxSize = function() {
6886
6924
  return;
@@ -8025,6 +8063,7 @@ To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product),
8025
8063
  if (this._tMode === "CUSTOM") {
8026
8064
  var state = this.getState(rowId);
8027
8065
  var action = this.getActionByState(state);
8066
+ delete dataToSend[this.action_param];
8028
8067
  var _onResolvedCreateUpdate = function(tag) {
8029
8068
  var resultState = state;
8030
8069
  if (tag && tag.responseText && tag.setRequestHeader) {
@@ -9162,7 +9201,7 @@ To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product),
9162
9201
  }
9163
9202
  }
9164
9203
  function factoryMethod(extensionManager) {
9165
- const scheduler2 = { version: "7.2.4" };
9204
+ const scheduler2 = { version: "7.2.6" };
9166
9205
  scheduler2.$stateProvider = StateService();
9167
9206
  scheduler2.getState = scheduler2.$stateProvider.getState;
9168
9207
  extend$n(scheduler2);
@@ -20668,6 +20707,12 @@ To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product),
20668
20707
  tooltip2.top = mouse.y - tooltip2.height - offsetY;
20669
20708
  tooltip2.bottom = tooltip2.top + tooltip2.height;
20670
20709
  }
20710
+ if (tooltip2.left < 0) {
20711
+ tooltip2.left = 0;
20712
+ }
20713
+ if (tooltip2.right < 0) {
20714
+ tooltip2.right = 0;
20715
+ }
20671
20716
  return tooltip2;
20672
20717
  }
20673
20718
  _getViewPortSize() {