Skip to content

Commit 7a891e0

Browse files
committed
[update] version 7.1.3
1 parent 1c78c7b commit 7a891e0

16 files changed

+2385
-2299
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# dhtmlxScheduler #
22

33
[![dhtmlx.com](https://img.shields.io/badge/made%20by-DHTMLX-blue)](https://dhtmlx.com/)
4-
[![npm: v.7.1.2](https://img.shields.io/badge/npm-v.7.1.2-blue.svg)](https://www.npmjs.com/package/dhtmlx-scheduler)
4+
[![npm: v.7.1.3](https://img.shields.io/badge/npm-v.7.1.3-blue.svg)](https://www.npmjs.com/package/dhtmlx-scheduler)
55
[![License: GPL v2](https://img.shields.io/badge/license-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
66

77
[DHTMLX Scheduler](https://dhtmlx.com/docs/products/dhtmlxScheduler) is a JavaScript library that allows you to add a Google-like scheduler to your web app or website.
@@ -87,7 +87,7 @@ scheduler.parse([
8787

8888
## License ##
8989

90-
dhtmlxScheduler v.7.1.2 Standard
90+
dhtmlxScheduler v.7.1.3 Standard
9191

9292
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
9393

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scheduler",
3-
"version": "7.1.2",
3+
"version": "7.1.3",
44
"homepage": "https://dhtmlx.com/docs/products/dhtmlxScheduler/",
55
"description": "JavaScript event calendar. Allows to manage events and appointments in different views",
66
"main": [

codebase/dhtmlxscheduler.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codebase/dhtmlxscheduler.es.js

Lines changed: 2153 additions & 2131 deletions
Large diffs are not rendered by default.

codebase/dhtmlxscheduler.es.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codebase/dhtmlxscheduler.js

Lines changed: 69 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codebase/dhtmlxscheduler.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codebase/sources/dhtmlxscheduler.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3285,7 +3285,7 @@ div.dhx_timeline_label_column_header .dhx_timeline_label_content_wrapper {
32853285
}
32863286
.dhx_cal_datepicker_days {
32873287
display: grid;
3288-
grid-template-columns: repeat(7, 1fr);
3288+
grid-template-columns: repeat(var(--dhx-scheduler-week-length, 7), 1fr);
32893289
gap: 4px;
32903290
}
32913291
.dhx_cal_datepicker_dayname,

codebase/sources/dhtmlxscheduler.es.js

Lines changed: 71 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/** @license
2+
3+
dhtmlxScheduler v.7.1.3 Standard
4+
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+
7+
(c) XB Software Ltd.
8+
9+
*/
110
function dhtmlxHook() {
211
if (typeof dhtmlx != "undefined" && dhtmlx.attaches) {
312
dhtmlx.attaches.attachScheduler = function(day, mode, tabs, scheduler2) {
@@ -134,7 +143,7 @@ function dragHighlightPos(scheduler2) {
134143
let unitMarkersArray = [];
135144
const { event: event3, layout, viewName, eventNode: eventNode2 } = settings;
136145
let sectionPropertyName = checkSectionPropertyName(viewName);
137-
if (scheduler2.config.multisection && sectionPropertyName) {
146+
if (sectionPropertyName) {
138147
const sections = String(event3[sectionPropertyName]).split(scheduler2.config.section_delimiter);
139148
const formatedSections = sections.map((element) => String(element));
140149
const elems = [];
@@ -3189,7 +3198,7 @@ function extend$j(scheduler2) {
31893198
} else {
31903199
excludedDuration += intervalEnd.getHours() * 60 * 60 * 1e3 + intervalEnd.getMinutes() * 60 * 1e3;
31913200
}
3192-
if (intervalStart.valueOf() < leftCellCutOffEnd.valueOf()) {
3201+
if (intervalStart.valueOf() <= leftCellCutOffEnd.valueOf()) {
31933202
excludedDuration += config._end_correction;
31943203
}
31953204
if (intervalStart.valueOf() < leftCellCutOffStart.valueOf()) {
@@ -8477,7 +8486,7 @@ function i18nFactory() {
84778486
}
84788487
class DatePicker {
84798488
constructor(scheduler2, container, state = {}) {
8480-
this.state = { date: /* @__PURE__ */ new Date(), modes: ["days", "months", "years"], currentRange: [], eventDates: [], currentModeIndex: 0, ...state };
8489+
this.state = { date: /* @__PURE__ */ new Date(), modes: ["days", "months", "years"], currentRange: [], eventDates: [], filterDays: null, currentModeIndex: 0, ...state };
84818490
this.container = null;
84828491
this.element = null;
84838492
this.onStateChangeHandlers = [];
@@ -8585,19 +8594,21 @@ class DatePicker {
85858594
}
85868595
}
85878596
_renderDayGridHeader(daysOfWeekContainer) {
8588-
const { date } = this.getState();
8597+
const { date, filterDays } = this.getState();
85898598
const scheduler2 = this.scheduler;
85908599
let currentDate = scheduler2.date.week_start(new Date(date));
85918600
const maxDate = scheduler2.date.add(scheduler2.date.week_start(new Date(date)), 1, "week");
85928601
daysOfWeekContainer.classList.add("dhx_cal_datepicker_days");
85938602
const labelFormat = scheduler2.date.date_to_str("%D");
85948603
while (currentDate.valueOf() < maxDate.valueOf()) {
8595-
const label = labelFormat(currentDate);
8596-
const dayElement = document.createElement("div");
8597-
dayElement.setAttribute("data-day", currentDate.getDay());
8598-
dayElement.classList.add("dhx_cal_datepicker_dayname");
8599-
dayElement.innerText = label;
8600-
daysOfWeekContainer.appendChild(dayElement);
8604+
if (!(filterDays && filterDays(currentDate))) {
8605+
const label = labelFormat(currentDate);
8606+
const dayElement = document.createElement("div");
8607+
dayElement.setAttribute("data-day", currentDate.getDay());
8608+
dayElement.classList.add("dhx_cal_datepicker_dayname");
8609+
dayElement.innerText = label;
8610+
daysOfWeekContainer.appendChild(dayElement);
8611+
}
86018612
currentDate = scheduler2.date.add(currentDate, 1, "day");
86028613
}
86038614
}
@@ -8612,7 +8623,7 @@ class DatePicker {
86128623
return weeks;
86138624
}
86148625
_renderDayGrid(container) {
8615-
const { date, currentRange, eventDates, minWeeks } = this.getState();
8626+
const { date, currentRange, eventDates, minWeeks, filterDays } = this.getState();
86168627
let minSchedulerDate = currentRange[0];
86178628
let maxSchedulerDate = currentRange[1];
86188629
const eventDaysTable = eventDates.reduce((acc, date2) => {
@@ -8622,7 +8633,11 @@ class DatePicker {
86228633
}, {});
86238634
const daysOfWeekContainer = document.createElement("div");
86248635
this._renderDayGridHeader(daysOfWeekContainer);
8636+
const weekLength = daysOfWeekContainer.children.length;
86258637
container.appendChild(daysOfWeekContainer);
8638+
if (weekLength !== 7) {
8639+
container.style.setProperty("--dhx-scheduler-week-length", weekLength);
8640+
}
86268641
const scheduler2 = this.scheduler;
86278642
const firstDate = scheduler2.date.week_start(scheduler2.date.month_start(new Date(date)));
86288643
const monthStart = scheduler2.date.month_start(new Date(date));
@@ -8645,31 +8660,33 @@ class DatePicker {
86458660
this.callEvent("onDateClick", [date2, event2]);
86468661
});
86478662
while (currDate.valueOf() < lastDate.valueOf()) {
8648-
const dayElement = document.createElement("div");
8649-
dayElement.setAttribute("data-cell-date", scheduler2.templates.format_date(currDate));
8650-
dayElement.setAttribute("data-day", currDate.getDay());
8651-
dayElement.innerHTML = currDate.getDate();
8652-
if (currDate.valueOf() < monthStart.valueOf()) {
8653-
dayElement.classList.add("dhx_before");
8654-
} else if (currDate.valueOf() >= monthEnd.valueOf()) {
8655-
dayElement.classList.add("dhx_after");
8656-
}
8657-
if (currDate.getDay() === 0 || currDate.getDay() === 6) {
8658-
dayElement.classList.add("dhx_cal_datepicker_weekend");
8659-
}
8660-
if (currDate.valueOf() == currentCalDate.valueOf()) {
8661-
dayElement.classList.add("dhx_now");
8662-
}
8663-
if (minSchedulerDate && maxSchedulerDate) {
8664-
if (currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()) {
8665-
dayElement.classList.add("dhx_cal_datepicker_current");
8663+
if (!(filterDays && filterDays(currDate))) {
8664+
const dayElement = document.createElement("div");
8665+
dayElement.setAttribute("data-cell-date", scheduler2.templates.format_date(currDate));
8666+
dayElement.setAttribute("data-day", currDate.getDay());
8667+
dayElement.innerHTML = currDate.getDate();
8668+
if (currDate.valueOf() < monthStart.valueOf()) {
8669+
dayElement.classList.add("dhx_before");
8670+
} else if (currDate.valueOf() >= monthEnd.valueOf()) {
8671+
dayElement.classList.add("dhx_after");
8672+
}
8673+
if (currDate.getDay() === 0 || currDate.getDay() === 6) {
8674+
dayElement.classList.add("dhx_cal_datepicker_weekend");
8675+
}
8676+
if (currDate.valueOf() == currentCalDate.valueOf()) {
8677+
dayElement.classList.add("dhx_now");
8678+
}
8679+
if (minSchedulerDate && maxSchedulerDate) {
8680+
if (currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()) {
8681+
dayElement.classList.add("dhx_cal_datepicker_current");
8682+
}
86668683
}
8684+
if (eventDaysTable[currDate.valueOf()]) {
8685+
dayElement.classList.add("dhx_cal_datepicker_event");
8686+
}
8687+
dayElement.classList.add("dhx_cal_datepicker_date");
8688+
dayGridContainer.appendChild(dayElement);
86678689
}
8668-
if (eventDaysTable[currDate.valueOf()]) {
8669-
dayElement.classList.add("dhx_cal_datepicker_event");
8670-
}
8671-
dayElement.classList.add("dhx_cal_datepicker_date");
8672-
dayGridContainer.appendChild(dayElement);
86738690
currDate = scheduler2.date.add(currDate, 1, "day");
86748691
}
86758692
container.appendChild(dayGridContainer);
@@ -8752,7 +8769,7 @@ class DatePicker {
87528769
}
87538770
}
87548771
function factoryMethod(extensionManager) {
8755-
const scheduler2 = { version: "7.1.2" };
8772+
const scheduler2 = { version: "7.1.3" };
87568773
scheduler2.$stateProvider = StateService();
87578774
scheduler2.getState = scheduler2.$stateProvider.getState;
87588775
extend$n(scheduler2);
@@ -9177,6 +9194,9 @@ function agenda_view(scheduler2) {
91779194
} else {
91789195
let html = "";
91799196
for (let day in eventsInDays) {
9197+
if (scheduler2.ignore_agenda && scheduler2.ignore_agenda(new Date(day * 1))) {
9198+
continue;
9199+
}
91809200
html += renderDay(new Date(day * 1), eventsInDays[day]);
91819201
}
91829202
scheduler2._els["dhx_cal_data"][0].innerHTML = html;
@@ -9196,7 +9216,7 @@ function agenda_view(scheduler2) {
91969216
return "";
91979217
}
91989218
let html = `
9199-
<div class="dhx_cal_agenda_day">
9219+
<div class="dhx_cal_agenda_day" data-date="${scheduler2.templates.format_date(day)}" data-day="${day.getDay()}">
92009220
<div class="dhx_cal_agenda_day_header">${scheduler2.templates.agenda_day(day)}</div>
92019221
<div class="dhx_cal_agenda_day_events">
92029222
`;
@@ -13935,6 +13955,9 @@ function minical(scheduler2) {
1393513955
end_date = scheduler2.date.date_part(obj.end_date);
1393613956
if (+end_date == +start_date || +end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0))
1393713957
end_date = scheduler2.date.add(end_date, 1, "day");
13958+
} else {
13959+
start_date = null;
13960+
end_date = null;
1393813961
}
1393913962
var start = start_date || ev.start_date;
1394013963
var end = end_date || ev.end_date;
@@ -17682,6 +17705,12 @@ function recurring(scheduler2) {
1768217705
scheduler2.addEvent(nev);
1768317706
scheduler2._not_render = false;
1768417707
}
17708+
function toUTCDate(date) {
17709+
return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()));
17710+
}
17711+
function setUTCPartsToDate(d) {
17712+
return new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds());
17713+
}
1768517714
scheduler2._rec_temp = [];
1768617715
scheduler2._rec_markers_pull = {};
1768717716
scheduler2._rec_markers = {};
@@ -17980,22 +18009,17 @@ function recurring(scheduler2) {
1798018009
if (!seriesExceptions) {
1798118010
seriesExceptions = {};
1798218011
}
17983-
if (!from) {
17984-
from = scheduler2._min_date;
17985-
}
17986-
if (!to) {
17987-
to = scheduler2._max_date;
17988-
}
17989-
const utcStart = new Date(Date.UTC(ev.start_date.getFullYear(), ev.start_date.getMonth(), ev.start_date.getDate(), ev.start_date.getHours(), ev.start_date.getMinutes(), ev.start_date.getSeconds()));
18012+
from = toUTCDate(from || new Date(scheduler2._min_date.valueOf() - 1e3));
18013+
to = toUTCDate(to || new Date(scheduler2._max_date.valueOf() - 1e3));
18014+
const utcStart = toUTCDate(ev.start_date);
1799018015
let parsedRRule;
1799118016
if (maxCount) {
1799218017
parsedRRule = rrulestr(`RRULE:${ev.rrule};UNTIL=${toIcalString(ev.end_date)};COUNT=${maxCount}`, { dtstart: utcStart });
1799318018
} else {
1799418019
parsedRRule = rrulestr(`RRULE:${ev.rrule};UNTIL=${toIcalString(ev.end_date)}`, { dtstart: utcStart });
1799518020
}
17996-
const utcTo = new Date(Date.UTC(to.getFullYear(), to.getMonth(), to.getDate(), to.getHours(), to.getMinutes(), to.getSeconds()));
17997-
const repeatedDates = parsedRRule.between(from, utcTo).map((date) => {
17998-
const adjustedDate = new Date(date);
18021+
const repeatedDates = parsedRRule.between(from, to, true).map((date) => {
18022+
const adjustedDate = setUTCPartsToDate(date);
1799918023
adjustedDate.setHours(ev.start_date.getHours());
1800018024
adjustedDate.setMinutes(ev.start_date.getMinutes());
1800118025
adjustedDate.setSeconds(ev.start_date.getSeconds());
@@ -20255,7 +20279,7 @@ function year_view(scheduler2) {
2025520279
yearBox.innerHTML = `<div class='dhx_year_month'>${this.templates.year_month(currentDate)}</div>
2025620280
<div class='dhx_year_grid'></div>`;
2025720281
const yearGrid = yearBox.querySelector(".dhx_year_grid");
20258-
const datepicker = scheduler2._createDatePicker(null, { date: currentDate, minWeeks: 6 });
20282+
const datepicker = scheduler2._createDatePicker(null, { date: currentDate, filterDays: scheduler2.ignore_year, minWeeks: 6 });
2025920283
datepicker._renderDayGrid(yearGrid);
2026020284
datepicker.destructor();
2026120285
wrapper.appendChild(yearBox);

codebase/sources/dhtmlxscheduler.es.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)