i-tech-shared-components 1.4.72 → 1.4.73-alpha.1775075798296

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.
@@ -3086,14 +3086,14 @@ class TimeInputComponent {
3086
3086
  const digit = parseInt(key, 10);
3087
3087
  this.hourBuffer += key;
3088
3088
  if (this.mode === '12h') {
3089
- if (this.hourBuffer.length === 1 && digit >= 2 && digit <= 9) {
3089
+ if (this.hourBuffer.length === 1 && digit >= 3 && digit <= 9) {
3090
3090
  this.hours = '0' + key;
3091
3091
  this.hourBuffer = '';
3092
3092
  this.activeSegment = 'minutes';
3093
3093
  }
3094
3094
  else if (this.hourBuffer.length === 2) {
3095
3095
  const num = parseInt(this.hourBuffer, 10);
3096
- if (num >= 1 && num <= 12) {
3096
+ if (num >= 1 && num <= 23) {
3097
3097
  this.hours = this.hourBuffer;
3098
3098
  }
3099
3099
  else {
@@ -3187,8 +3187,10 @@ class TimeInputComponent {
3187
3187
  if (this.minuteBuffer.length === 1 && digit >= 6) {
3188
3188
  this.minutes = '0' + key;
3189
3189
  this.minuteBuffer = '';
3190
- if (this.mode === '12h')
3190
+ if (this.mode === '12h') {
3191
+ this.convertIfOver12Hours();
3191
3192
  this.activeSegment = 'ampm';
3193
+ }
3192
3194
  else
3193
3195
  this.deactivate();
3194
3196
  }
@@ -3201,8 +3203,10 @@ class TimeInputComponent {
3201
3203
  this.minutes = '0' + this.minuteBuffer[1];
3202
3204
  }
3203
3205
  this.minuteBuffer = '';
3204
- if (this.mode === '12h')
3206
+ if (this.mode === '12h') {
3207
+ this.convertIfOver12Hours();
3205
3208
  this.activeSegment = 'ampm';
3209
+ }
3206
3210
  else
3207
3211
  this.deactivate();
3208
3212
  }
@@ -3211,6 +3215,15 @@ class TimeInputComponent {
3211
3215
  }
3212
3216
  this.emitControlValue();
3213
3217
  }
3218
+ convertIfOver12Hours() {
3219
+ if (this.hours === '--')
3220
+ return;
3221
+ const h = parseInt(this.hours, 10);
3222
+ if (h > 12) {
3223
+ this.hours = String(h - 12).padStart(2, '0');
3224
+ this.amPm = 'PM';
3225
+ }
3226
+ }
3214
3227
  adjustMinutes(delta) {
3215
3228
  const current = this.minutes === '--' ? 0 : parseInt(this.minutes, 10);
3216
3229
  let next = current + delta;