@syncfusion/ej2-schedule 20.2.36 → 20.2.38

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.
@@ -6047,6 +6047,7 @@ var EventBase = /** @__PURE__ @class */ (function () {
6047
6047
  for (var _i = 0, dates_1 = dates; _i < dates_1.length; _i++) {
6048
6048
  var date = dates_1[_i];
6049
6049
  var clonedObject = extend({}, event, null, true);
6050
+ date = this.getDSTAdjustedTime(date, clonedObject);
6050
6051
  clonedObject[this.parent.eventFields.startTime] = new Date(date);
6051
6052
  clonedObject[this.parent.eventFields.endTime] = new Date(new Date(date).setMilliseconds(duration));
6052
6053
  clonedObject[this.parent.eventFields.recurrenceID] = clonedObject[this.parent.eventFields.id];
@@ -6057,6 +6058,21 @@ var EventBase = /** @__PURE__ @class */ (function () {
6057
6058
  }
6058
6059
  return occurrenceCollection;
6059
6060
  };
6061
+ EventBase.prototype.getDSTAdjustedTime = function (date, event) {
6062
+ var occurDate = date;
6063
+ if (this.parent.timezone &&
6064
+ (event[this.parent.eventFields.startTimezone] || event[this.parent.eventFields.endTimezone])) {
6065
+ var eventOffset = this.getDSTDiff(event[this.parent.eventFields.startTime], new Date(date), event[this.parent.eventFields.startTimezone]);
6066
+ var schOffset = this.getDSTDiff(event[this.parent.eventFields.startTime], new Date(date), this.parent.timezone);
6067
+ occurDate = (new Date(date).getTime() - (eventOffset - schOffset) * 60000);
6068
+ }
6069
+ return occurDate;
6070
+ };
6071
+ EventBase.prototype.getDSTDiff = function (startDate, occurDate, timezone) {
6072
+ var startOffset = this.parent.tzModule.offset(new Date(startDate), timezone);
6073
+ var occurOffset = this.parent.tzModule.offset(new Date(occurDate), timezone);
6074
+ return startOffset - occurOffset;
6075
+ };
6060
6076
  EventBase.prototype.getParentEvent = function (eventObj, isParent) {
6061
6077
  if (isParent === void 0) { isParent = false; }
6062
6078
  var parentEvent;
@@ -11537,6 +11553,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
11537
11553
  EventWindow.prototype.setDialogContent = function () {
11538
11554
  this.dialogObject.content = this.getEventWindowContent();
11539
11555
  this.dialogObject.dataBind();
11556
+ this.applyFormValidation();
11540
11557
  };
11541
11558
  EventWindow.prototype.preventEventSave = function (e) {
11542
11559
  if (this.parent && !this.parent.allowKeyboardInteraction && e.code === 'Enter') {
@@ -26120,7 +26137,7 @@ var ICalendarExport = /** @__PURE__ @class */ (function () {
26120
26137
  var timeZone = this.parent.timezone || this.parent.tzModule.getLocalTimezoneName();
26121
26138
  var fields = this.parent.eventFields;
26122
26139
  eventsData.forEach(function (eventObj) {
26123
- var uId = _this.parent.eventBase.generateGuid();
26140
+ var uId = eventObj[fields.id] || eventObj.Guid || _this.parent.eventBase.generateGuid();
26124
26141
  var editedExDate = [];
26125
26142
  if (eventObj[fields.recurrenceID]) {
26126
26143
  var filter = _this.filterEvents(filterCollection, fields.id, eventObj[fields.recurrenceID]);
@@ -26324,8 +26341,16 @@ var ICalendarImport = /** @__PURE__ @class */ (function () {
26324
26341
  break;
26325
26342
  case 'UID':
26326
26343
  curEvent[uId] = value;
26327
- curEvent[fields.id] = typeof (id) === 'string' ? id + count.toString() : id + count;
26328
- count++;
26344
+ if (typeof (id) == 'number') {
26345
+ curEvent[fields.id] = parseInt(value, 10);
26346
+ if (isNaN(curEvent[fields.id])) {
26347
+ curEvent[fields.id] = id + count;
26348
+ count++;
26349
+ }
26350
+ }
26351
+ else {
26352
+ curEvent[fields.id] = value;
26353
+ }
26329
26354
  break;
26330
26355
  case 'SUMMARY':
26331
26356
  curEvent[fields.subject] = value;
@@ -26361,6 +26386,10 @@ var ICalendarImport = /** @__PURE__ @class */ (function () {
26361
26386
  var appoint = [];
26362
26387
  var uId = 'UID';
26363
26388
  var fields = this.parent.eventFields;
26389
+ var appointmentIds = [];
26390
+ this.parent.eventsData.forEach(function (eventObj) {
26391
+ appointmentIds.push(eventObj[fields.id]);
26392
+ });
26364
26393
  app.forEach(function (eventObj) {
26365
26394
  var parentObj;
26366
26395
  var id;
@@ -26369,24 +26398,26 @@ var ICalendarImport = /** @__PURE__ @class */ (function () {
26369
26398
  parentObj = eventObj;
26370
26399
  id = eventObj[fields.id];
26371
26400
  }
26372
- var data = app.filter(function (data) { return data.UID === eventObj[uId]; });
26373
- if (data.length > 1 && isNullOrUndefined(eventObj[fields.recurrenceID])) {
26374
- for (var i = 0; i < data.length; i++) {
26375
- // eslint-disable-next-line no-prototype-builtins
26376
- if (data[i].hasOwnProperty(fields.recurrenceID)) {
26377
- var exdate = data[i][fields.recurrenceID];
26378
- data[i][fields.recurrenceID] = id;
26379
- data[i][fields.recurrenceException] = null;
26380
- parentObj[fields.recurrenceException] = (isNullOrUndefined(parentObj[fields.recurrenceException])) ?
26381
- exdate : parentObj[fields.recurrenceException] + ',' + exdate;
26382
- appoint.push(data[i]);
26401
+ if (appointmentIds.indexOf(eventObj[fields.id]) < 0) {
26402
+ var data = app.filter(function (data) { return data.UID === eventObj[uId]; });
26403
+ if (data.length > 1 && isNullOrUndefined(eventObj[fields.recurrenceID])) {
26404
+ for (var i = 0; i < data.length; i++) {
26405
+ // eslint-disable-next-line no-prototype-builtins
26406
+ if (data[i].hasOwnProperty(fields.recurrenceID)) {
26407
+ var exdate = data[i][fields.recurrenceID];
26408
+ data[i][fields.recurrenceID] = id;
26409
+ data[i][fields.recurrenceException] = null;
26410
+ parentObj[fields.recurrenceException] = (isNullOrUndefined(parentObj[fields.recurrenceException])) ?
26411
+ exdate : parentObj[fields.recurrenceException] + ',' + exdate;
26412
+ appoint.push(data[i]);
26413
+ }
26383
26414
  }
26415
+ appoint.push(parentObj);
26416
+ // eslint-disable-next-line no-prototype-builtins
26417
+ }
26418
+ else if (!eventObj.hasOwnProperty(fields.recurrenceID)) {
26419
+ appoint.push(eventObj);
26384
26420
  }
26385
- appoint.push(parentObj);
26386
- // eslint-disable-next-line no-prototype-builtins
26387
- }
26388
- else if (!eventObj.hasOwnProperty(fields.recurrenceID)) {
26389
- appoint.push(eventObj);
26390
26421
  }
26391
26422
  });
26392
26423
  return appoint;