@syncfusion/ej2-calendars 24.2.5 → 24.2.9

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.
@@ -32,7 +32,7 @@ var DEVICE = 'e-device';
32
32
  var HEADER = 'e-header';
33
33
  var RTL = 'e-rtl';
34
34
  var CONTENT = 'e-content';
35
- var CONTENTTABLE = 'e-content-table';
35
+ var CONTENTTABLE = 'e-calandar-content-table';
36
36
  var YEAR = 'e-year';
37
37
  var MONTH = 'e-month';
38
38
  var DECADE = 'e-decade';
@@ -497,19 +497,19 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
497
497
  this.effect = '';
498
498
  switch (e.action) {
499
499
  case 'moveLeft':
500
- if (this.getModuleName() != 'daterangepicker' && !isNullOrUndefined(e.target) && e.target.classList.length > 0 && e.target.classList.contains('e-content-table')) {
500
+ if (this.getModuleName() != 'daterangepicker' && !isNullOrUndefined(e.target) && e.target.classList.length > 0 && e.target.classList.contains(CONTENTTABLE)) {
501
501
  this.keyboardNavigate(-1, view, e, this.max, this.min);
502
502
  e.preventDefault();
503
503
  }
504
504
  break;
505
505
  case 'moveRight':
506
- if (this.getModuleName() != 'daterangepicker' && !isNullOrUndefined(e.target) && e.target.classList.length > 0 && e.target.classList.contains('e-content-table')) {
506
+ if (this.getModuleName() != 'daterangepicker' && !isNullOrUndefined(e.target) && e.target.classList.length > 0 && e.target.classList.contains(CONTENTTABLE)) {
507
507
  this.keyboardNavigate(1, view, e, this.max, this.min);
508
508
  e.preventDefault();
509
509
  }
510
510
  break;
511
511
  case 'moveUp':
512
- if (this.getModuleName() != 'daterangepicker' && !isNullOrUndefined(e.target) && e.target.classList.length > 0 && e.target.classList.contains('e-content-table')) {
512
+ if (this.getModuleName() != 'daterangepicker' && !isNullOrUndefined(e.target) && e.target.classList.length > 0 && e.target.classList.contains(CONTENTTABLE)) {
513
513
  if (view === 0) {
514
514
  this.keyboardNavigate(-7, view, e, this.max, this.min); // move the current date to the previous seven days.
515
515
  }
@@ -520,7 +520,7 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
520
520
  }
521
521
  break;
522
522
  case 'moveDown':
523
- if (this.getModuleName() != 'daterangepicker' && !isNullOrUndefined(e.target) && e.target.classList.length > 0 && e.target.classList.contains('e-content-table')) {
523
+ if (this.getModuleName() != 'daterangepicker' && !isNullOrUndefined(e.target) && e.target.classList.length > 0 && e.target.classList.contains(CONTENTTABLE)) {
524
524
  if (view === 0) {
525
525
  this.keyboardNavigate(7, view, e, this.max, this.min);
526
526
  }
@@ -4165,7 +4165,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
4165
4165
  }
4166
4166
  if ((this.getModuleName() === 'datetimepicker')) {
4167
4167
  if (this.checkDateValue(this.globalize.parseDate(this.inputElement.value, dateOptions))) {
4168
- date = this.globalize.parseDate(this.inputElement.value.toLocaleUpperCase(), dateOptions);
4168
+ var modifiedValue = this.inputElement.value.replace(/(am|pm|Am|aM|pM|Pm)/g, function (match) { return match.toLocaleUpperCase(); });
4169
+ date = this.globalize.parseDate(modifiedValue, dateOptions);
4169
4170
  }
4170
4171
  else {
4171
4172
  if (this.calendarMode === 'Gregorian') {
@@ -5478,7 +5479,6 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
5478
5479
  _this.invalidValueString = null;
5479
5480
  _this.isAngular = false;
5480
5481
  _this.preventChange = false;
5481
- _this.isKeyPressed = false;
5482
5482
  _this.dateRangeOptions = options;
5483
5483
  return _this;
5484
5484
  }
@@ -5834,7 +5834,6 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
5834
5834
  EventHandler.add(this.inputElement, 'focus', this.inputFocusHandler, this);
5835
5835
  EventHandler.add(this.inputElement, 'blur', this.inputBlurHandler, this);
5836
5836
  EventHandler.add(this.inputElement, 'change', this.inputChangeHandler, this);
5837
- EventHandler.add(this.inputElement, 'keyup', this.keyupHandler, this);
5838
5837
  if (this.showClearButton && this.inputWrapper.clearButton) {
5839
5838
  EventHandler.add(this.inputWrapper.clearButton, 'mousedown', this.resetHandler, this);
5840
5839
  }
@@ -5861,7 +5860,6 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
5861
5860
  EventHandler.remove(this.inputElement, 'blur', this.inputBlurHandler);
5862
5861
  EventHandler.remove(this.inputElement, 'focus', this.inputFocusHandler);
5863
5862
  EventHandler.remove(this.inputElement, 'change', this.inputChangeHandler);
5864
- EventHandler.remove(this.inputElement, 'keyup', this.keyupHandler);
5865
5863
  if (this.showClearButton && this.inputWrapper.clearButton) {
5866
5864
  EventHandler.remove(this.inputWrapper.clearButton, 'mousedown touchstart', this.resetHandler);
5867
5865
  }
@@ -6116,8 +6114,8 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
6116
6114
  var startDate = this.presetsItem[i].start;
6117
6115
  var endDate = this.presetsItem[i].end;
6118
6116
  if (this.startValue && this.endValue) {
6119
- if ((+new Date(startDate.setHours(0, 0, 0, 0)) === +new Date(this.startValue.setHours(0, 0, 0, 0))) &&
6120
- (+new Date(endDate.setHours(0, 0, 0, 0)) === +new Date(this.endValue.setHours(0, 0, 0, 0)))) {
6117
+ if (startDate.getDate() == this.startValue.getDate() && startDate.getMonth() == this.startValue.getMonth() && startDate.getFullYear() == this.startValue.getFullYear()
6118
+ && endDate.getDate() == this.endValue.getDate() && endDate.getMonth() == this.endValue.getMonth() && endDate.getFullYear() == this.endValue.getFullYear()) {
6121
6119
  this.activeIndex = i;
6122
6120
  this.isCustomRange = false;
6123
6121
  }
@@ -8096,9 +8094,6 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
8096
8094
  this.startButton.element.classList.add(ACTIVE$1);
8097
8095
  }
8098
8096
  };
8099
- DateRangePicker.prototype.keyupHandler = function (e) {
8100
- this.isKeyPressed = (this.inputElement.value !== this.previousEleValue) ? true : false;
8101
- };
8102
8097
  DateRangePicker.prototype.applyFunction = function (eve) {
8103
8098
  var isValueChanged = false;
8104
8099
  if (eve.type !== 'touchstart') {
@@ -8121,13 +8116,15 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
8121
8116
  eve.preventDefault();
8122
8117
  }
8123
8118
  if (!isNullOrUndefined(this.startValue) && !isNullOrUndefined(this.endValue)) {
8119
+ if (!(this.previousStartValue && this.previousEndValue && this.startValue.getDate() == this.previousStartValue.getDate() && this.startValue.getMonth() == this.previousStartValue.getMonth() &&
8120
+ this.startValue.getFullYear() == this.previousStartValue.getFullYear()
8121
+ && this.endValue.getDate() == this.previousEndValue.getDate() && this.endValue.getMonth() == this.previousEndValue.getMonth()
8122
+ && this.endValue.getFullYear() == this.previousEndValue.getFullYear())) {
8123
+ Input.setValue(this.rangeArgs(eve).text, this.inputElement, this.floatLabelType, this.showClearButton);
8124
+ }
8124
8125
  this.previousStartValue = new Date(+this.startValue);
8125
8126
  this.previousEndValue = new Date(+this.endValue);
8126
8127
  this.previousEleValue = this.inputElement.value;
8127
- if (!this.isKeyPressed) {
8128
- Input.setValue(this.rangeArgs(eve).text, this.inputElement, this.floatLabelType, this.showClearButton);
8129
- }
8130
- this.isKeyPressed = false;
8131
8128
  if (+this.initStartDate !== +this.startValue || +this.initEndDate !== +this.endValue) {
8132
8129
  isValueChanged = true;
8133
8130
  }
@@ -12032,10 +12029,6 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
12032
12029
  }
12033
12030
  }
12034
12031
  removeClass([this.inputWrapper.container], [FOCUS]);
12035
- var blurArguments = {
12036
- model: this
12037
- };
12038
- this.trigger('blur', blurArguments);
12039
12032
  if (this.getText() !== this.inputElement.value) {
12040
12033
  this.updateValue((this.inputElement).value, e);
12041
12034
  }
@@ -12047,6 +12040,10 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
12047
12040
  if (this.inputElement.value === '') {
12048
12041
  this.invalidValueString = null;
12049
12042
  }
12043
+ var blurArguments = {
12044
+ model: this
12045
+ };
12046
+ this.trigger('blur', blurArguments);
12050
12047
  };
12051
12048
  /**
12052
12049
  * Focuses out the TimePicker textbox element.
@@ -14605,6 +14602,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
14605
14602
  {
14606
14603
  var year = (this.isYearPart && (newDateValue.getFullYear().toString().length < 4
14607
14604
  && !this.isShortYear) ? newDateValue.getFullYear() * 10 : 0) + parseInt(newVal[start - 1], 10);
14605
+ var yearValue = (this.dateformat.match(/y/g) || []).length;
14608
14606
  this.isShortYear = false;
14609
14607
  this.isYearZero = (newVal[start - 1] === '0');
14610
14608
  if (isNaN(year)) {
@@ -14618,7 +14616,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
14618
14616
  }
14619
14617
  else {
14620
14618
  newDateValue.setFullYear(year);
14621
- if (year.toString().length === 4) {
14619
+ if (year.toString().length === yearValue) {
14622
14620
  this.isNavigate = true;
14623
14621
  }
14624
14622
  this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
@@ -14793,9 +14791,6 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
14793
14791
  case 'yy':
14794
14792
  result = proxy.isYearPart ? proxy.roundOff(proxy.maskDateValue.getFullYear() % 100, 2) : proxy.defaultConstant['year'].toString();
14795
14793
  result = proxy.zeroCheck(proxy.isYearZero, proxy.isYearPart, result);
14796
- if (proxy.isYearPart) {
14797
- proxy.isNavigate = proxy.isShortYear = (proxy.maskDateValue.getFullYear() % 100).toString().length === 2;
14798
- }
14799
14794
  break;
14800
14795
  case 'y':
14801
14796
  case 'yyyy':