@syncfusion/ej2-calendars 21.2.4 → 21.2.5

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.
@@ -2899,6 +2899,10 @@ var Islamic = /** @__PURE__ @class */ (function () {
2899
2899
  var endFullYr = endYr.getFullYear();
2900
2900
  var startHdrYr = this.calendarInstance.globalize.formatDate(startYr, { type: 'dateTime', format: 'y', calendar: 'islamic' });
2901
2901
  var endHdrYr = this.calendarInstance.globalize.formatDate(endYr, { type: 'dateTime', format: 'y', calendar: 'islamic' });
2902
+ if (this.calendarInstance.locale === 'ar') {
2903
+ startHdrYr = Number(startHdrYr.replace(/[٠١٢٣٤٥٦٧٨٩]/g, function (d) { return String.fromCharCode(d.charCodeAt(0) - 1632 + 48); }));
2904
+ endHdrYr = Number(endHdrYr.replace(/[٠١٢٣٤٥٦٧٨٩]/g, function (d) { return String.fromCharCode(d.charCodeAt(0) - 1632 + 48); }));
2905
+ }
2902
2906
  var splityear = this.calendarInstance.headerElement.textContent.split('-');
2903
2907
  if ((!isNullOrUndefined(e) && (splityear[0] !== startHdrYr) && e.action === 'home') || (!isNullOrUndefined(e) && e.type === 'keydown' && e.action === 'end')) {
2904
2908
  startHdrYr = this.calendarInstance.headerElement.textContent.split('-')[0].trim();
@@ -2960,7 +2964,14 @@ var Islamic = /** @__PURE__ @class */ (function () {
2960
2964
  ? (parseInt(endHdrYr, 10) + 2).toString() : endHdrYr - startHdrYr === 8
2961
2965
  ? (parseInt(endHdrYr, 10) + 1).toString() : endHdrYr;
2962
2966
  }
2963
- this.calendarInstance.headerTitleElement.textContent = startHdrYr + ' - ' + (endHdrYr);
2967
+ if (this.calendarInstance.locale === 'ar') {
2968
+ var startHeaderYear = this.calendarInstance.globalize.formatDate(startYr, { type: 'dateTime', format: 'y', calendar: 'islamic' });
2969
+ var endHeaderYear = this.calendarInstance.globalize.formatDate(endYr, { type: 'dateTime', format: 'y', calendar: 'islamic' });
2970
+ this.calendarInstance.headerTitleElement.textContent = startHeaderYear + ' - ' + (endHeaderYear);
2971
+ }
2972
+ else {
2973
+ this.calendarInstance.headerTitleElement.textContent = startHdrYr + ' - ' + (endHdrYr);
2974
+ }
2964
2975
  this.calendarInstance.nextIconClicked = this.calendarInstance.previousIconClicked = false;
2965
2976
  var year = (parseInt(startHdrYr, 10) - 2).toString();
2966
2977
  startFullYr = Math.round(parseInt(startHdrYr, 10) * 0.97 + 622);
@@ -12009,7 +12020,7 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
12009
12020
  this.invalidValueString = null;
12010
12021
  this.checkInvalidValue(newProp.value);
12011
12022
  newProp.value = this.value;
12012
- if (!this.invalidValueString && !this.enableMask) {
12023
+ if (!this.invalidValueString) {
12013
12024
  if (typeof newProp.value === 'string') {
12014
12025
  this.setProperties({ value: this.checkDateValue(new Date(newProp.value)) }, true);
12015
12026
  newProp.value = this.value;
@@ -12022,14 +12033,14 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
12022
12033
  this.initValue = newProp.value;
12023
12034
  newProp.value = this.compareFormatChange(this.checkValue(newProp.value));
12024
12035
  }
12025
- else if (this.enableMask) {
12026
- this.updateInputValue(this.maskedDateValue);
12027
- this.checkErrorState(this.maskedDateValue);
12028
- }
12029
12036
  else {
12030
12037
  this.updateInputValue(this.invalidValueString);
12031
12038
  this.checkErrorState(this.invalidValueString);
12032
12039
  }
12040
+ if (this.enableMask && isNullOrUndefined(newProp.value)) {
12041
+ this.updateInputValue(this.maskedDateValue);
12042
+ this.checkErrorState(this.maskedDateValue);
12043
+ }
12033
12044
  this.checkValueChange(null, false);
12034
12045
  if (this.isPopupOpen()) {
12035
12046
  this.setScrollPosition();