@syncfusion/ej2-calendars 23.2.4 → 23.2.7

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.
@@ -1279,8 +1279,14 @@ let CalendarBase = class CalendarBase extends Component {
1279
1279
  this.createContentHeader();
1280
1280
  this.createContentBody();
1281
1281
  }
1282
+ if (this.getModuleName() === 'calendar') {
1283
+ const l10nLocale = { today: 'Today' };
1284
+ this.l10 = new L10n(this.getModuleName(), l10nLocale, this.locale);
1285
+ }
1282
1286
  this.l10.setLocale(this.locale);
1283
- this.updateFooter();
1287
+ if (this.showTodayButton) {
1288
+ this.updateFooter();
1289
+ }
1284
1290
  break;
1285
1291
  case 'showTodayButton':
1286
1292
  if (newProp.showTodayButton) {
@@ -5032,8 +5038,10 @@ let DatePicker = class DatePicker extends Calendar {
5032
5038
  case 'locale':
5033
5039
  this.globalize = new Internationalization(this.locale);
5034
5040
  this.l10n.setLocale(this.locale);
5035
- this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
5036
- Input.setPlaceholder(this.placeholder, this.inputElement);
5041
+ if (this.datepickerOptions && this.datepickerOptions.placeholder == null) {
5042
+ this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
5043
+ Input.setPlaceholder(this.placeholder, this.inputElement);
5044
+ }
5037
5045
  this.updateInput();
5038
5046
  if (this.enableMask) {
5039
5047
  this.notify('createMask', {
@@ -9323,8 +9331,10 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
9323
9331
  setLocale() {
9324
9332
  this.globalize = new Internationalization(this.locale);
9325
9333
  this.l10n.setLocale(this.locale);
9326
- this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
9327
- Input.setPlaceholder(this.placeholder, this.inputElement);
9334
+ if (this.dateRangeOptions && this.dateRangeOptions.placeholder == null) {
9335
+ this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
9336
+ Input.setPlaceholder(this.placeholder, this.inputElement);
9337
+ }
9328
9338
  this.updateInput();
9329
9339
  this.updateHiddenInput();
9330
9340
  this.changeTrigger();
@@ -9480,8 +9490,10 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
9480
9490
  case 'locale':
9481
9491
  this.globalize = new Internationalization(this.locale);
9482
9492
  this.l10n.setLocale(this.locale);
9483
- this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
9484
- Input.setPlaceholder(this.placeholder, this.inputElement);
9493
+ if (this.dateRangeOptions && this.dateRangeOptions.placeholder == null) {
9494
+ this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
9495
+ Input.setPlaceholder(this.placeholder, this.inputElement);
9496
+ }
9485
9497
  this.setLocale();
9486
9498
  break;
9487
9499
  case 'htmlAttributes':
@@ -12108,7 +12120,9 @@ let TimePicker = class TimePicker extends Component {
12108
12120
  this.setProperties({ locale: newProp.locale }, true);
12109
12121
  this.globalize = new Internationalization(this.locale);
12110
12122
  this.l10n.setLocale(this.locale);
12111
- this.updatePlaceHolder();
12123
+ if (this.timeOptions && this.timeOptions.placeholder == null) {
12124
+ this.updatePlaceHolder();
12125
+ }
12112
12126
  this.setValue(this.value);
12113
12127
  if (this.enableMask) {
12114
12128
  this.notify('createMask', {
@@ -13748,8 +13762,10 @@ let DateTimePicker = class DateTimePicker extends DatePicker {
13748
13762
  case 'locale':
13749
13763
  this.globalize = new Internationalization(this.locale);
13750
13764
  this.l10n.setLocale(this.locale);
13751
- this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
13752
- Input.setPlaceholder(this.l10n.getConstant('placeholder'), this.inputElement);
13765
+ if (this.dateTimeOptions && this.dateTimeOptions.placeholder == null) {
13766
+ this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
13767
+ Input.setPlaceholder(this.l10n.getConstant('placeholder'), this.inputElement);
13768
+ }
13753
13769
  this.dateTimeFormat = this.cldrDateTimeFormat();
13754
13770
  super.updateInput();
13755
13771
  break;
@@ -14012,6 +14028,7 @@ class MaskedDateTime {
14012
14028
  this.isDateZero = false;
14013
14029
  this.isMonthZero = false;
14014
14030
  this.isYearZero = false;
14031
+ this.isLeadingZero = false;
14015
14032
  this.dayTypeCount = 0;
14016
14033
  this.monthTypeCount = 0;
14017
14034
  this.hourTypeCount = 0;
@@ -14255,7 +14272,18 @@ class MaskedDateTime {
14255
14272
  }
14256
14273
  if (month >= 1) {
14257
14274
  newDateValue.setMonth(month - 1);
14258
- this.isNavigate = month.toString().length === 2;
14275
+ if (month >= 10 || month == 1) {
14276
+ if (this.isLeadingZero && month == 1) {
14277
+ this.isNavigate = month.toString().length === 1;
14278
+ this.isLeadingZero = false;
14279
+ }
14280
+ else {
14281
+ this.isNavigate = month.toString().length === 2;
14282
+ }
14283
+ }
14284
+ else {
14285
+ this.isNavigate = month.toString().length === 1;
14286
+ }
14259
14287
  if (newDateValue.getMonth() !== month - 1) {
14260
14288
  newDateValue.setDate(1);
14261
14289
  newDateValue.setMonth(month - 1);
@@ -14273,6 +14301,7 @@ class MaskedDateTime {
14273
14301
  }
14274
14302
  else {
14275
14303
  newDateValue.setMonth(0);
14304
+ this.isLeadingZero = true;
14276
14305
  this.isMonthPart = false;
14277
14306
  this.monthTypeCount = this.isMonthZero ? this.monthTypeCount + 1 : this.monthTypeCount;
14278
14307
  }