@syncfusion/ej2-calendars 21.2.3 → 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.
@@ -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);
@@ -4413,7 +4424,7 @@ let DatePicker = class DatePicker extends Calendar {
4413
4424
  this.modal = null;
4414
4425
  }
4415
4426
  if (Browser.isDevice) {
4416
- if (!isNullOrUndefined(this.mobilePopupWrapper)) {
4427
+ if (!isNullOrUndefined(this.mobilePopupWrapper) && (prevent && (isNullOrUndefined(this.preventArgs) || !this.preventArgs.cancel))) {
4417
4428
  this.mobilePopupWrapper.remove();
4418
4429
  this.mobilePopupWrapper = null;
4419
4430
  }
@@ -11885,7 +11896,7 @@ let TimePicker = class TimePicker extends Component {
11885
11896
  this.invalidValueString = null;
11886
11897
  this.checkInvalidValue(newProp.value);
11887
11898
  newProp.value = this.value;
11888
- if (!this.invalidValueString && !this.enableMask) {
11899
+ if (!this.invalidValueString) {
11889
11900
  if (typeof newProp.value === 'string') {
11890
11901
  this.setProperties({ value: this.checkDateValue(new Date(newProp.value)) }, true);
11891
11902
  newProp.value = this.value;
@@ -11898,14 +11909,14 @@ let TimePicker = class TimePicker extends Component {
11898
11909
  this.initValue = newProp.value;
11899
11910
  newProp.value = this.compareFormatChange(this.checkValue(newProp.value));
11900
11911
  }
11901
- else if (this.enableMask) {
11902
- this.updateInputValue(this.maskedDateValue);
11903
- this.checkErrorState(this.maskedDateValue);
11904
- }
11905
11912
  else {
11906
11913
  this.updateInputValue(this.invalidValueString);
11907
11914
  this.checkErrorState(this.invalidValueString);
11908
11915
  }
11916
+ if (this.enableMask && isNullOrUndefined(newProp.value)) {
11917
+ this.updateInputValue(this.maskedDateValue);
11918
+ this.checkErrorState(this.maskedDateValue);
11919
+ }
11909
11920
  this.checkValueChange(null, false);
11910
11921
  if (this.isPopupOpen()) {
11911
11922
  this.setScrollPosition();