|
1 | 1 | /** @license |
2 | 2 |
|
3 | | -dhtmlxScheduler v.7.2.4 Standard |
| 3 | +dhtmlxScheduler v.7.2.5 Standard |
4 | 4 |
|
5 | 5 | 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 |
6 | 6 |
|
@@ -2730,8 +2730,17 @@ function extend$j(scheduler2) { |
2730 | 2730 | start = this._drag_start; |
2731 | 2731 | } |
2732 | 2732 | } else { |
2733 | | - if (end <= start) |
2734 | | - end = start + timeStep * 6e4; |
| 2733 | + if (end <= start) { |
| 2734 | + if (obj && obj.round_position) { |
| 2735 | + if (obj.x_unit == "hour" || obj.x_unit == "minute") { |
| 2736 | + end = scheduler2.date.add(start, obj.x_step, obj.x_unit); |
| 2737 | + } else { |
| 2738 | + end = scheduler2.date.add(scheduler2.date.date_part(new Date(start)), 1, obj.x_unit); |
| 2739 | + } |
| 2740 | + } else { |
| 2741 | + end = start + timeStep * 6e4; |
| 2742 | + } |
| 2743 | + } |
2735 | 2744 | } |
2736 | 2745 | } |
2737 | 2746 | var new_end = new Date(end - 1); |
@@ -3328,8 +3337,8 @@ function extend$j(scheduler2) { |
3328 | 3337 | scheduler2._render_month_scale = function(div, dd, sd, rows) { |
3329 | 3338 | var ed = scheduler2.date.add(dd, 1, "month"), view_start = new Date(sd); |
3330 | 3339 | var cd = scheduler2._currentDate(); |
3331 | | - this.date.date_part(cd); |
3332 | | - this.date.date_part(sd); |
| 3340 | + cd = this.date.date_part(cd); |
| 3341 | + sd = this.date.date_part(sd); |
3333 | 3342 | rows = rows || Math.ceil(Math.round((ed.valueOf() - sd.valueOf()) / (60 * 60 * 24 * 1e3)) / 7); |
3334 | 3343 | var tdwidths = []; |
3335 | 3344 | for (var i = 0; i <= 7; i++) { |
@@ -3414,9 +3423,7 @@ function extend$j(scheduler2) { |
3414 | 3423 | }; |
3415 | 3424 | scheduler2._reset_month_scale = function(b, dd, sd, rows) { |
3416 | 3425 | var ed = scheduler2.date.add(dd, 1, "month"); |
3417 | | - var cd = scheduler2._currentDate(); |
3418 | | - this.date.date_part(cd); |
3419 | | - this.date.date_part(sd); |
| 3426 | + sd = this.date.date_part(sd); |
3420 | 3427 | rows = rows || Math.ceil(Math.round((ed.valueOf() - sd.valueOf()) / (60 * 60 * 24 * 1e3)) / 7); |
3421 | 3428 | var height = Math.floor(b.clientHeight / rows) - this.xy.month_head_height; |
3422 | 3429 | this._colsS.height = height + this.xy.month_head_height; |
@@ -6877,6 +6884,37 @@ function extend$6(scheduler2) { |
6877 | 6884 | break; |
6878 | 6885 | } |
6879 | 6886 | }); |
| 6887 | + function getDaysInMonth(year, month) { |
| 6888 | + return new Date(year, month + 1, 0).getDate(); |
| 6889 | + } |
| 6890 | + scheduler2.event(lightbox, "click", function(e) { |
| 6891 | + if (e.target.closest(".dhx_lightbox_day_select") || e.target.closest(".dhx_lightbox_month_select")) { |
| 6892 | + const monthSelectNodes = lightbox.querySelectorAll(".dhx_lightbox_month_select"); |
| 6893 | + const daySelectNodes = lightbox.querySelectorAll(".dhx_lightbox_day_select"); |
| 6894 | + const yearSelectNodes = lightbox.querySelectorAll(".dhx_lightbox_year_select"); |
| 6895 | + if (monthSelectNodes.length && daySelectNodes.length && yearSelectNodes) { |
| 6896 | + monthSelectNodes.forEach((select, i) => { |
| 6897 | + const daySelect = daySelectNodes[i]; |
| 6898 | + const month = parseInt(select.value, 10); |
| 6899 | + let year = parseInt(yearSelectNodes[i].value, 10); |
| 6900 | + if (!year) { |
| 6901 | + year = new Date(scheduler2.getState().date).getFullYear(); |
| 6902 | + } |
| 6903 | + const daysInMonth = getDaysInMonth(year, month); |
| 6904 | + const maxDays = daysInMonth || 31; |
| 6905 | + let curDayValue = daySelect.value; |
| 6906 | + daySelect.innerHTML = ""; |
| 6907 | + for (let day = 1; day <= maxDays; day++) { |
| 6908 | + const option = document.createElement("option"); |
| 6909 | + option.value = day; |
| 6910 | + option.textContent = day; |
| 6911 | + daySelect.appendChild(option); |
| 6912 | + } |
| 6913 | + daySelect.value = Math.min(curDayValue, maxDays); |
| 6914 | + }); |
| 6915 | + } |
| 6916 | + } |
| 6917 | + }); |
6880 | 6918 | }; |
6881 | 6919 | scheduler2.setLightboxSize = function() { |
6882 | 6920 | return; |
@@ -9158,7 +9196,7 @@ class DatePicker { |
9158 | 9196 | } |
9159 | 9197 | } |
9160 | 9198 | function factoryMethod(extensionManager) { |
9161 | | - const scheduler2 = { version: "7.2.4" }; |
| 9199 | + const scheduler2 = { version: "7.2.5" }; |
9162 | 9200 | scheduler2.$stateProvider = StateService(); |
9163 | 9201 | scheduler2.getState = scheduler2.$stateProvider.getState; |
9164 | 9202 | extend$n(scheduler2); |
@@ -20664,6 +20702,12 @@ class Tooltip { |
20664 | 20702 | tooltip2.top = mouse.y - tooltip2.height - offsetY; |
20665 | 20703 | tooltip2.bottom = tooltip2.top + tooltip2.height; |
20666 | 20704 | } |
| 20705 | + if (tooltip2.left < 0) { |
| 20706 | + tooltip2.left = 0; |
| 20707 | + } |
| 20708 | + if (tooltip2.right < 0) { |
| 20709 | + tooltip2.right = 0; |
| 20710 | + } |
20667 | 20711 | return tooltip2; |
20668 | 20712 | } |
20669 | 20713 | _getViewPortSize() { |
|
0 commit comments