@syncfusion/ej2-schedule 28.2.4 → 28.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.
@@ -21967,16 +21967,12 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
21967
21967
  }
21968
21968
  else {
21969
21969
  var cellWidth = this.actionObj.cellWidth;
21970
- cellIndex = isLeft ? Math.floor(offset / this.actionObj.cellWidth) :
21970
+ cellIndex = isLeft ? Math.round(offset / this.actionObj.cellWidth) :
21971
21971
  Math.ceil((offset + (this.parent.getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
21972
21972
  if (this.parent.enableRtl) {
21973
- var cellOffsetWidth = 0;
21974
- if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
21975
- !isTimelineMonth)) {
21976
- cellOffsetWidth = this.actionObj.cellWidth;
21977
- }
21978
- var offsetWidth = (Math.floor(offset / this.actionObj.cellWidth) *
21979
- this.actionObj.cellWidth) + (isLeft ? 0 : this.parent.getElementWidth(this.actionObj.clone) - cellOffsetWidth);
21973
+ var offsetWidth = (Math.round(offset / this.actionObj.cellWidth) *
21974
+ this.actionObj.cellWidth) + (isLeft ? 0 : (this.parent.getElementWidth(this.actionObj.clone) -
21975
+ this.actionObj.cellWidth));
21980
21976
  cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
21981
21977
  }
21982
21978
  isLastCell = cellIndex === tdCollections.length;
@@ -21997,11 +21993,11 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
21997
21993
  if (!isLeft) {
21998
21994
  offset += this.parent.getElementWidth(this.actionObj.clone);
21999
21995
  }
22000
- var spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
21996
+ var spanMinutes = Math.floor((this.actionObj.slotInterval / this.actionObj.cellWidth) *
22001
21997
  (offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
22002
21998
  spanMinutes = (isLastCell || (!isLeft && spanMinutes === 0)) ? this.actionObj.slotInterval : spanMinutes;
22003
21999
  resizeTime = new Date(resizeDate.getTime());
22004
- resizeTime.setMinutes(resizeTime.getMinutes() + spanMinutes);
22000
+ resizeTime = new Date(resizeDate.getTime() + (spanMinutes * MS_PER_MINUTE));
22005
22001
  this.updateTimePosition(resizeTime);
22006
22002
  }
22007
22003
  }
@@ -22071,11 +22067,12 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
22071
22067
  var slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
22072
22068
  var pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
22073
22069
  var targetWidth = isTimelineView ?
22074
- (this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
22070
+ Math.round(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
22075
22071
  this.parent.currentView === 'Month' ? this.parent.getElementWidth(this.actionObj.element) :
22076
22072
  Math.ceil(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
22077
22073
  var offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
22078
22074
  var left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
22075
+ left = Math.round(left / slotInterval) * slotInterval;
22079
22076
  if (isTimeViews) {
22080
22077
  offsetWidth = targetWidth + (Math.ceil(pageWidth / slotInterval) * slotInterval);
22081
22078
  if (!isLeft) {
@@ -22094,6 +22091,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
22094
22091
  -(offsetWidth - this.actionObj.cellWidth);
22095
22092
  rightValue = isTimelineView ? rightValue : isLeft ? 0 : rightValue > 0 ? 0 : rightValue;
22096
22093
  if (isTimelineView && !isLeft) {
22094
+ rightValue = Math.round(rightValue / slotInterval) * slotInterval;
22097
22095
  rightValue = rightValue - (Math.ceil((this.actionObj.pageX - this.actionObj.X) / slotInterval) * slotInterval);
22098
22096
  if (rightValue < 0) {
22099
22097
  rightValue = parseInt(this.actionObj.clone.style.right, 10);
@@ -25213,9 +25211,16 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
25213
25211
  var endHour = this.getStartEndHours(this.parent.activeViewOptions.endHour);
25214
25212
  var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
25215
25213
  var hoursRange = getStartEndHours(resetTime(new Date(date.getTime())), startHour, endHour);
25216
- var interval = this.parent.activeViewOptions.timeScale.slotCount !== 1 ?
25217
- this.parent.activeViewOptions.timeScale.interval :
25218
- (hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / MS_PER_MINUTE;
25214
+ var totalMinutes = (hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / MS_PER_MINUTE;
25215
+ var timescaleInterval = this.parent.activeViewOptions.timeScale.interval;
25216
+ var interval = 0;
25217
+ if (startHour.getHours() === 0 && startHour.getMinutes() === 0 && endHour.getHours() === 0 && endHour.getMinutes() === 0) {
25218
+ interval = timescaleInterval;
25219
+ }
25220
+ else {
25221
+ interval = (this.parent.activeViewOptions.timeScale.slotCount !== 1) ? timescaleInterval :
25222
+ (timescaleInterval > totalMinutes ? totalMinutes : timescaleInterval);
25223
+ }
25219
25224
  return (diffInMinutes * this.getWorkCellHeight() * this.parent.activeViewOptions.timeScale.slotCount) / interval;
25220
25225
  };
25221
25226
  VerticalView.prototype.getWorkCellHeight = function () {
@@ -27994,7 +27999,7 @@ var MonthAgenda = /** @__PURE__ @class */ (function (_super) {
27994
27999
  return 'abbreviated';
27995
28000
  };
27996
28001
  MonthAgenda.prototype.updateSelectedCellClass = function (data) {
27997
- if (resetTime(data.date).getTime() === resetTime(this.monthAgendaDate).getTime()) {
28002
+ if (resetTime(data.date).getTime() === resetTime(new Date('' + this.parent.selectedDate)).getTime()) {
27998
28003
  data.className.push(SELECTED_CELL_CLASS);
27999
28004
  }
28000
28005
  };
@@ -28055,6 +28060,7 @@ var MonthAgenda = /** @__PURE__ @class */ (function (_super) {
28055
28060
  this.onEventRender(filterData, event.startTime);
28056
28061
  this.parent.notify(eventsLoaded, {});
28057
28062
  this.monthAgendaDate = new Date('' + event.startTime);
28063
+ this.parent.setProperties({ selectedDate: this.monthAgendaDate }, true);
28058
28064
  };
28059
28065
  MonthAgenda.prototype.onEventRender = function (events, date) {
28060
28066
  this.agendaBase = this.getAgendaBase();
@@ -28402,9 +28408,16 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
28402
28408
  var diffInDates = 0;
28403
28409
  var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
28404
28410
  var hoursRange = getStartEndHours(resetTime(new Date(date.getTime())), startHour, endHour);
28405
- var interval = this.parent.activeViewOptions.timeScale.slotCount !== 1 ?
28406
- this.parent.activeViewOptions.timeScale.interval :
28407
- (hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / MS_PER_MINUTE;
28411
+ var totalMinutes = (hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / MS_PER_MINUTE;
28412
+ var timescaleInterval = this.parent.activeViewOptions.timeScale.interval;
28413
+ var interval = 0;
28414
+ if (startHour.getHours() === 0 && startHour.getMinutes() === 0 && endHour.getHours() === 0 && endHour.getMinutes() === 0) {
28415
+ interval = timescaleInterval;
28416
+ }
28417
+ else {
28418
+ interval = (this.parent.activeViewOptions.timeScale.slotCount !== 1) ? timescaleInterval :
28419
+ (timescaleInterval > totalMinutes ? totalMinutes : timescaleInterval);
28420
+ }
28408
28421
  if (!isNullOrUndefined(currentDateIndex)) {
28409
28422
  if (currentDateIndex[0] !== 0) {
28410
28423
  var index = this.parent.activeView.colLevels.findIndex(function (level) { return level[0].type === 'dateHeader'; });