@syncfusion/ej2-schedule 20.1.48 → 20.1.50

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.
@@ -3731,6 +3731,9 @@ function dailyType(startDate, endDate, data, ruleObject) {
3731
3731
  }
3732
3732
  }
3733
3733
  tempDate.setDate(tempDate.getDate() + interval);
3734
+ if (tempDate.getHours() !== startDate.getHours()) {
3735
+ tempDate.setHours(startDate.getHours());
3736
+ }
3734
3737
  }
3735
3738
  }
3736
3739
  /**
@@ -3775,6 +3778,9 @@ function weeklyType(startDate, endDate, data, ruleObject) {
3775
3778
  break;
3776
3779
  }
3777
3780
  tempDate.setDate(tempDate.getDate() + 1);
3781
+ if (tempDate.getHours() !== startDate.getHours()) {
3782
+ tempDate.setHours(startDate.getHours());
3783
+ }
3778
3784
  compareTempDate = new Date(tempDate.getTime());
3779
3785
  compareTempDate = resetTime(compareTempDate);
3780
3786
  }
@@ -4656,7 +4662,7 @@ function insertDateCollection(state, startDate, endDate, data, ruleObject, dayDa
4656
4662
  function weekCount(year, startDayOfWeek, monthCollection, week, ruleObject) {
4657
4663
  const firstDayOfWeek = startDayOfWeek || 0;
4658
4664
  const firstOfMonth = new Date(year, ruleObject.month[0] - 1, 1);
4659
- const lastOfMonth = new Date(year, ruleObject.month[0] - 1, 0);
4665
+ const lastOfMonth = new Date(year, ruleObject.month[0], 0);
4660
4666
  const numberOfDaysInMonth = lastOfMonth.getDate();
4661
4667
  const firstWeekDay = (firstOfMonth.getDay() - firstDayOfWeek + 7) % 7;
4662
4668
  const used = firstWeekDay + numberOfDaysInMonth;
@@ -7082,7 +7088,6 @@ class MonthEvent extends EventBase {
7082
7088
  constructor(parent) {
7083
7089
  super(parent);
7084
7090
  this.renderedEvents = [];
7085
- this.eventsRendered = [];
7086
7091
  this.monthHeaderHeight = 0;
7087
7092
  this.moreIndicatorHeight = 19;
7088
7093
  this.renderType = 'day';
@@ -7196,7 +7201,6 @@ class MonthEvent extends EventBase {
7196
7201
  }
7197
7202
  renderEventsHandler(dateRender, workDays, resData) {
7198
7203
  this.renderedEvents = [];
7199
- this.eventsRendered = [];
7200
7204
  let eventsList;
7201
7205
  let blockList;
7202
7206
  let resIndex = 0;
@@ -7232,11 +7236,18 @@ class MonthEvent extends EventBase {
7232
7236
  const filteredDates = this.getRenderedDates(dateRender);
7233
7237
  this.getSlotDates(workDays || this.parent.activeViewOptions.workDays);
7234
7238
  this.processBlockEvents(blockList, resIndex, resData);
7239
+ let events = [];
7235
7240
  for (const event of eventsList) {
7236
7241
  if (this.parent.resourceBase && !resData) {
7237
7242
  this.cssClass = this.parent.resourceBase.getCssClass(event);
7238
7243
  }
7239
- const spannedEvents = this.splitEvent(event, filteredDates || this.dateRender);
7244
+ events = events.concat(this.splitEvent(event, filteredDates || this.dateRender));
7245
+ }
7246
+ for (let level = 0; level < this.slots.length; level++) {
7247
+ this.renderedEvents = [];
7248
+ const slot = this.slots[level];
7249
+ const endDate = addDays(new Date(slot[slot.length - 1]), 1);
7250
+ const spannedEvents = this.filterEvents(new Date(slot[0]), endDate, events);
7240
7251
  for (const event of spannedEvents) {
7241
7252
  if (this.maxHeight) {
7242
7253
  const sDate = this.parent.currentView === 'Month' ? event[this.fields.startTime] :
@@ -7535,12 +7546,8 @@ class MonthEvent extends EventBase {
7535
7546
  if (day < 0) {
7536
7547
  return;
7537
7548
  }
7538
- if ((startTime.getTime() < this.parent.minDate.getTime()) || (endTime.getTime() > this.parent.maxDate.getTime())) {
7539
- return;
7540
- }
7541
7549
  const overlapCount = this.getIndex(startTime);
7542
7550
  event.Index = overlapCount;
7543
- this.renderedEvents.push(extend({}, event, null, true));
7544
7551
  const diffInDays = event.data.count;
7545
7552
  if (startTime.getTime() <= endTime.getTime()) {
7546
7553
  const appWidth = (diffInDays * this.cellWidth) - 5;
@@ -7549,7 +7556,7 @@ class MonthEvent extends EventBase {
7549
7556
  const height = this.monthHeaderHeight + ((overlapCount + 1) * (this.eventHeight + EVENT_GAP)) + this.moreIndicatorHeight;
7550
7557
  const enableAppRender = this.maxOrIndicator ? overlapCount < 1 ? true : false : this.cellHeight > height;
7551
7558
  if (this.parent.rowAutoHeight || enableAppRender) {
7552
- this.eventsRendered.push(extend({}, event, null, true));
7559
+ this.renderedEvents.push(extend({}, event, null, true));
7553
7560
  let appointmentElement;
7554
7561
  if (this.inlineValue) {
7555
7562
  appointmentElement = this.parent.inlineModule.createInlineAppointmentElement();
@@ -7565,37 +7572,30 @@ class MonthEvent extends EventBase {
7565
7572
  const firstChild = cellTd.parentElement.firstElementChild;
7566
7573
  this.updateCellHeight(firstChild, height);
7567
7574
  }
7568
- else if (cellTd.querySelector('.' + MORE_INDICATOR_CLASS)) {
7569
- this.renderMoreIndicators(diffInDays, day);
7570
- }
7571
7575
  }
7572
7576
  else {
7573
- this.renderMoreIndicators(diffInDays, day);
7574
- }
7575
- }
7576
- }
7577
- renderMoreIndicators(diffInDays, day) {
7578
- for (let i = 0; i < diffInDays; i++) {
7579
- if (this.workCells[day + i]) {
7580
- const startDate = new Date(this.dateRender[day + i].getTime());
7581
- const endDate = addDays(this.dateRender[day + i], 1);
7582
- const groupIndex = this.workCells[day + i].getAttribute('data-group-index');
7583
- const filterEvents = this.getFilteredEvents(startDate, endDate, groupIndex);
7584
- const renderedAppCount = this.getOverlapEvents(startDate, this.eventsRendered).length;
7585
- const count = (filterEvents.length - renderedAppCount) <= 0 ? 1 : (filterEvents.length - renderedAppCount);
7586
- const indicator = this.workCells[day + i].querySelector('.' + MORE_INDICATOR_CLASS);
7587
- if (indicator) {
7588
- indicator.innerHTML = this.getMoreIndicatorText(count);
7589
- }
7590
- else {
7591
- const moreIndicatorElement = this.getMoreIndicatorElement(count, startDate, endDate);
7592
- if (!isNullOrUndefined(groupIndex)) {
7593
- moreIndicatorElement.setAttribute('data-group-index', groupIndex);
7577
+ for (let i = 0; i < diffInDays; i++) {
7578
+ if (this.workCells[day + i]) {
7579
+ const indicator = this.workCells[day + i].querySelector('.' + MORE_INDICATOR_CLASS);
7580
+ if (indicator) {
7581
+ const count = parseInt(indicator.getAttribute('data-count'), 10) + 1;
7582
+ indicator.setAttribute('data-count', count.toString());
7583
+ indicator.innerHTML = this.getMoreIndicatorText(count);
7584
+ }
7585
+ else {
7586
+ const startDate = new Date(this.dateRender[day + i].getTime());
7587
+ const endDate = addDays(this.dateRender[day + i], 1);
7588
+ const groupIndex = this.workCells[day + i].getAttribute('data-group-index');
7589
+ const moreIndicatorElement = this.getMoreIndicatorElement(1, startDate, endDate);
7590
+ if (!isNullOrUndefined(groupIndex)) {
7591
+ moreIndicatorElement.setAttribute('data-group-index', groupIndex);
7592
+ }
7593
+ moreIndicatorElement.style.top = (this.cellHeight - this.monthHeaderHeight - this.moreIndicatorHeight) + 'px';
7594
+ moreIndicatorElement.style.width = this.cellWidth - 2 + 'px';
7595
+ this.renderElement(this.workCells[day + i], moreIndicatorElement);
7596
+ EventHandler.add(moreIndicatorElement, 'click', this.moreIndicatorClick, this);
7597
+ }
7594
7598
  }
7595
- moreIndicatorElement.style.top = (this.cellHeight - this.monthHeaderHeight - this.moreIndicatorHeight) + 'px';
7596
- moreIndicatorElement.style.width = this.cellWidth - 2 + 'px';
7597
- this.renderElement(this.workCells[day + i], moreIndicatorElement);
7598
- EventHandler.add(moreIndicatorElement, 'click', this.moreIndicatorClick, this);
7599
7599
  }
7600
7600
  }
7601
7601
  }
@@ -7630,8 +7630,8 @@ class MonthEvent extends EventBase {
7630
7630
  }
7631
7631
  getOverlapEvents(date, appointments) {
7632
7632
  const appointmentsList = [];
7633
+ const dateTime = resetTime(date).getTime();
7633
7634
  for (const app of appointments) {
7634
- const dateTime = resetTime(date).getTime();
7635
7635
  if ((resetTime(app[this.fields.startTime]).getTime() <= dateTime) &&
7636
7636
  (resetTime(app[this.fields.endTime]).getTime() >= dateTime)) {
7637
7637
  appointmentsList.push(app);
@@ -7715,6 +7715,7 @@ class MonthEvent extends EventBase {
7715
7715
  innerHTML: this.getMoreIndicatorText(count),
7716
7716
  attrs: {
7717
7717
  'tabindex': '0',
7718
+ 'data-count': count.toString(),
7718
7719
  'data-start-date': startDate.getTime().toString(),
7719
7720
  'data-end-date': endDate.getTime().toString(),
7720
7721
  'role': 'list'
@@ -24985,7 +24986,7 @@ class ICalendarExport {
24985
24986
  const editedExDate = [];
24986
24987
  if (eventObj[fields.recurrenceID]) {
24987
24988
  const filter = this.filterEvents(filterCollection, fields.id, eventObj[fields.recurrenceID]);
24988
- uId = filter[0].UID;
24989
+ uId = filter.length > 0 ? filter[0].UID : uId;
24989
24990
  }
24990
24991
  if (!eventObj[fields.recurrenceID] && eventObj[fields.recurrenceRule] && eventObj[fields.recurrenceException]) {
24991
24992
  const exDate = (eventObj[fields.recurrenceException]).split(',');