@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.
@@ -21220,16 +21220,12 @@ class Resize extends ActionBase {
21220
21220
  }
21221
21221
  else {
21222
21222
  const cellWidth = this.actionObj.cellWidth;
21223
- cellIndex = isLeft ? Math.floor(offset / this.actionObj.cellWidth) :
21223
+ cellIndex = isLeft ? Math.round(offset / this.actionObj.cellWidth) :
21224
21224
  Math.ceil((offset + (this.parent.getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
21225
21225
  if (this.parent.enableRtl) {
21226
- let cellOffsetWidth = 0;
21227
- if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
21228
- !isTimelineMonth)) {
21229
- cellOffsetWidth = this.actionObj.cellWidth;
21230
- }
21231
- const offsetWidth = (Math.floor(offset / this.actionObj.cellWidth) *
21232
- this.actionObj.cellWidth) + (isLeft ? 0 : this.parent.getElementWidth(this.actionObj.clone) - cellOffsetWidth);
21226
+ const offsetWidth = (Math.round(offset / this.actionObj.cellWidth) *
21227
+ this.actionObj.cellWidth) + (isLeft ? 0 : (this.parent.getElementWidth(this.actionObj.clone) -
21228
+ this.actionObj.cellWidth));
21233
21229
  cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
21234
21230
  }
21235
21231
  isLastCell = cellIndex === tdCollections.length;
@@ -21250,11 +21246,11 @@ class Resize extends ActionBase {
21250
21246
  if (!isLeft) {
21251
21247
  offset += this.parent.getElementWidth(this.actionObj.clone);
21252
21248
  }
21253
- let spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
21249
+ let spanMinutes = Math.floor((this.actionObj.slotInterval / this.actionObj.cellWidth) *
21254
21250
  (offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
21255
21251
  spanMinutes = (isLastCell || (!isLeft && spanMinutes === 0)) ? this.actionObj.slotInterval : spanMinutes;
21256
21252
  resizeTime = new Date(resizeDate.getTime());
21257
- resizeTime.setMinutes(resizeTime.getMinutes() + spanMinutes);
21253
+ resizeTime = new Date(resizeDate.getTime() + (spanMinutes * MS_PER_MINUTE));
21258
21254
  this.updateTimePosition(resizeTime);
21259
21255
  }
21260
21256
  }
@@ -21324,11 +21320,12 @@ class Resize extends ActionBase {
21324
21320
  const slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
21325
21321
  const pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
21326
21322
  const targetWidth = isTimelineView ?
21327
- (this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
21323
+ Math.round(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
21328
21324
  this.parent.currentView === 'Month' ? this.parent.getElementWidth(this.actionObj.element) :
21329
21325
  Math.ceil(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
21330
21326
  let offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
21331
- const left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
21327
+ let left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
21328
+ left = Math.round(left / slotInterval) * slotInterval;
21332
21329
  if (isTimeViews) {
21333
21330
  offsetWidth = targetWidth + (Math.ceil(pageWidth / slotInterval) * slotInterval);
21334
21331
  if (!isLeft) {
@@ -21347,6 +21344,7 @@ class Resize extends ActionBase {
21347
21344
  -(offsetWidth - this.actionObj.cellWidth);
21348
21345
  rightValue = isTimelineView ? rightValue : isLeft ? 0 : rightValue > 0 ? 0 : rightValue;
21349
21346
  if (isTimelineView && !isLeft) {
21347
+ rightValue = Math.round(rightValue / slotInterval) * slotInterval;
21350
21348
  rightValue = rightValue - (Math.ceil((this.actionObj.pageX - this.actionObj.X) / slotInterval) * slotInterval);
21351
21349
  if (rightValue < 0) {
21352
21350
  rightValue = parseInt(this.actionObj.clone.style.right, 10);
@@ -24356,9 +24354,16 @@ class VerticalView extends ViewBase {
24356
24354
  const endHour = this.getStartEndHours(this.parent.activeViewOptions.endHour);
24357
24355
  const diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
24358
24356
  const hoursRange = getStartEndHours(resetTime(new Date(date.getTime())), startHour, endHour);
24359
- const interval = this.parent.activeViewOptions.timeScale.slotCount !== 1 ?
24360
- this.parent.activeViewOptions.timeScale.interval :
24361
- (hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / MS_PER_MINUTE;
24357
+ const totalMinutes = (hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / MS_PER_MINUTE;
24358
+ const timescaleInterval = this.parent.activeViewOptions.timeScale.interval;
24359
+ let interval = 0;
24360
+ if (startHour.getHours() === 0 && startHour.getMinutes() === 0 && endHour.getHours() === 0 && endHour.getMinutes() === 0) {
24361
+ interval = timescaleInterval;
24362
+ }
24363
+ else {
24364
+ interval = (this.parent.activeViewOptions.timeScale.slotCount !== 1) ? timescaleInterval :
24365
+ (timescaleInterval > totalMinutes ? totalMinutes : timescaleInterval);
24366
+ }
24362
24367
  return (diffInMinutes * this.getWorkCellHeight() * this.parent.activeViewOptions.timeScale.slotCount) / interval;
24363
24368
  }
24364
24369
  getWorkCellHeight() {
@@ -26976,7 +26981,7 @@ class MonthAgenda extends Month {
26976
26981
  return 'abbreviated';
26977
26982
  }
26978
26983
  updateSelectedCellClass(data) {
26979
- if (resetTime(data.date).getTime() === resetTime(this.monthAgendaDate).getTime()) {
26984
+ if (resetTime(data.date).getTime() === resetTime(new Date('' + this.parent.selectedDate)).getTime()) {
26980
26985
  data.className.push(SELECTED_CELL_CLASS);
26981
26986
  }
26982
26987
  }
@@ -27036,6 +27041,7 @@ class MonthAgenda extends Month {
27036
27041
  this.onEventRender(filterData, event.startTime);
27037
27042
  this.parent.notify(eventsLoaded, {});
27038
27043
  this.monthAgendaDate = new Date('' + event.startTime);
27044
+ this.parent.setProperties({ selectedDate: this.monthAgendaDate }, true);
27039
27045
  }
27040
27046
  onEventRender(events, date) {
27041
27047
  this.agendaBase = this.getAgendaBase();
@@ -27355,9 +27361,16 @@ class TimelineViews extends VerticalView {
27355
27361
  let diffInDates = 0;
27356
27362
  let diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
27357
27363
  const hoursRange = getStartEndHours(resetTime(new Date(date.getTime())), startHour, endHour);
27358
- const interval = this.parent.activeViewOptions.timeScale.slotCount !== 1 ?
27359
- this.parent.activeViewOptions.timeScale.interval :
27360
- (hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / MS_PER_MINUTE;
27364
+ const totalMinutes = (hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / MS_PER_MINUTE;
27365
+ const timescaleInterval = this.parent.activeViewOptions.timeScale.interval;
27366
+ let interval = 0;
27367
+ if (startHour.getHours() === 0 && startHour.getMinutes() === 0 && endHour.getHours() === 0 && endHour.getMinutes() === 0) {
27368
+ interval = timescaleInterval;
27369
+ }
27370
+ else {
27371
+ interval = (this.parent.activeViewOptions.timeScale.slotCount !== 1) ? timescaleInterval :
27372
+ (timescaleInterval > totalMinutes ? totalMinutes : timescaleInterval);
27373
+ }
27361
27374
  if (!isNullOrUndefined(currentDateIndex)) {
27362
27375
  if (currentDateIndex[0] !== 0) {
27363
27376
  const index = this.parent.activeView.colLevels.findIndex((level) => level[0].type === 'dateHeader');