@syncfusion/ej2-calendars 21.2.4 → 21.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.
@@ -2876,6 +2876,10 @@ class Islamic {
2876
2876
  let endFullYr = endYr.getFullYear();
2877
2877
  let startHdrYr = this.calendarInstance.globalize.formatDate(startYr, { type: 'dateTime', format: 'y', calendar: 'islamic' });
2878
2878
  let endHdrYr = this.calendarInstance.globalize.formatDate(endYr, { type: 'dateTime', format: 'y', calendar: 'islamic' });
2879
+ if (this.calendarInstance.locale === 'ar') {
2880
+ startHdrYr = Number(startHdrYr.replace(/[٠١٢٣٤٥٦٧٨٩]/g, (d) => String.fromCharCode(d.charCodeAt(0) - 1632 + 48)));
2881
+ endHdrYr = Number(endHdrYr.replace(/[٠١٢٣٤٥٦٧٨٩]/g, (d) => String.fromCharCode(d.charCodeAt(0) - 1632 + 48)));
2882
+ }
2879
2883
  const splityear = this.calendarInstance.headerElement.textContent.split('-');
2880
2884
  if ((!isNullOrUndefined(e) && (splityear[0] !== startHdrYr) && e.action === 'home') || (!isNullOrUndefined(e) && e.type === 'keydown' && e.action === 'end')) {
2881
2885
  startHdrYr = this.calendarInstance.headerElement.textContent.split('-')[0].trim();
@@ -2937,7 +2941,14 @@ class Islamic {
2937
2941
  ? (parseInt(endHdrYr, 10) + 2).toString() : endHdrYr - startHdrYr === 8
2938
2942
  ? (parseInt(endHdrYr, 10) + 1).toString() : endHdrYr;
2939
2943
  }
2940
- this.calendarInstance.headerTitleElement.textContent = startHdrYr + ' - ' + (endHdrYr);
2944
+ if (this.calendarInstance.locale === 'ar') {
2945
+ const startHeaderYear = this.calendarInstance.globalize.formatDate(startYr, { type: 'dateTime', format: 'y', calendar: 'islamic' });
2946
+ const endHeaderYear = this.calendarInstance.globalize.formatDate(endYr, { type: 'dateTime', format: 'y', calendar: 'islamic' });
2947
+ this.calendarInstance.headerTitleElement.textContent = startHeaderYear + ' - ' + (endHeaderYear);
2948
+ }
2949
+ else {
2950
+ this.calendarInstance.headerTitleElement.textContent = startHdrYr + ' - ' + (endHdrYr);
2951
+ }
2941
2952
  this.calendarInstance.nextIconClicked = this.calendarInstance.previousIconClicked = false;
2942
2953
  const year = (parseInt(startHdrYr, 10) - 2).toString();
2943
2954
  startFullYr = Math.round(parseInt(startHdrYr, 10) * 0.97 + 622);
@@ -10067,7 +10078,6 @@ let TimePicker = class TimePicker extends Component {
10067
10078
  this.generateList();
10068
10079
  append([this.listWrapper], this.popupWrapper);
10069
10080
  }
10070
- this.openPopupEventArgs.appendTo.appendChild(this.popupWrapper);
10071
10081
  this.addSelection();
10072
10082
  this.renderPopup();
10073
10083
  detach(this.popupWrapper);
@@ -11885,7 +11895,7 @@ let TimePicker = class TimePicker extends Component {
11885
11895
  this.invalidValueString = null;
11886
11896
  this.checkInvalidValue(newProp.value);
11887
11897
  newProp.value = this.value;
11888
- if (!this.invalidValueString && !this.enableMask) {
11898
+ if (!this.invalidValueString) {
11889
11899
  if (typeof newProp.value === 'string') {
11890
11900
  this.setProperties({ value: this.checkDateValue(new Date(newProp.value)) }, true);
11891
11901
  newProp.value = this.value;
@@ -11898,14 +11908,14 @@ let TimePicker = class TimePicker extends Component {
11898
11908
  this.initValue = newProp.value;
11899
11909
  newProp.value = this.compareFormatChange(this.checkValue(newProp.value));
11900
11910
  }
11901
- else if (this.enableMask) {
11902
- this.updateInputValue(this.maskedDateValue);
11903
- this.checkErrorState(this.maskedDateValue);
11904
- }
11905
11911
  else {
11906
11912
  this.updateInputValue(this.invalidValueString);
11907
11913
  this.checkErrorState(this.invalidValueString);
11908
11914
  }
11915
+ if (this.enableMask && isNullOrUndefined(newProp.value)) {
11916
+ this.updateInputValue(this.maskedDateValue);
11917
+ this.checkErrorState(this.maskedDateValue);
11918
+ }
11909
11919
  this.checkValueChange(null, false);
11910
11920
  if (this.isPopupOpen()) {
11911
11921
  this.setScrollPosition();