i-tech-shared-components 1.4.68 → 1.4.69-alpha.1773604918196
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.
|
@@ -3092,14 +3092,14 @@ class TimeInputComponent {
|
|
|
3092
3092
|
const digit = parseInt(key, 10);
|
|
3093
3093
|
this.hourBuffer += key;
|
|
3094
3094
|
if (this.mode === '12h') {
|
|
3095
|
-
if (this.hourBuffer.length === 1 && digit >=
|
|
3095
|
+
if (this.hourBuffer.length === 1 && digit >= 3 && digit <= 9) {
|
|
3096
3096
|
this.hours = '0' + key;
|
|
3097
3097
|
this.hourBuffer = '';
|
|
3098
3098
|
this.activeSegment = 'minutes';
|
|
3099
3099
|
}
|
|
3100
3100
|
else if (this.hourBuffer.length === 2) {
|
|
3101
3101
|
const num = parseInt(this.hourBuffer, 10);
|
|
3102
|
-
if (num >= 1 && num <=
|
|
3102
|
+
if (num >= 1 && num <= 23) {
|
|
3103
3103
|
this.hours = this.hourBuffer;
|
|
3104
3104
|
}
|
|
3105
3105
|
else {
|
|
@@ -3193,8 +3193,10 @@ class TimeInputComponent {
|
|
|
3193
3193
|
if (this.minuteBuffer.length === 1 && digit >= 6) {
|
|
3194
3194
|
this.minutes = '0' + key;
|
|
3195
3195
|
this.minuteBuffer = '';
|
|
3196
|
-
if (this.mode === '12h')
|
|
3196
|
+
if (this.mode === '12h') {
|
|
3197
|
+
this.convertIfOver12Hours();
|
|
3197
3198
|
this.activeSegment = 'ampm';
|
|
3199
|
+
}
|
|
3198
3200
|
else
|
|
3199
3201
|
this.deactivate();
|
|
3200
3202
|
}
|
|
@@ -3207,8 +3209,10 @@ class TimeInputComponent {
|
|
|
3207
3209
|
this.minutes = '0' + this.minuteBuffer[1];
|
|
3208
3210
|
}
|
|
3209
3211
|
this.minuteBuffer = '';
|
|
3210
|
-
if (this.mode === '12h')
|
|
3212
|
+
if (this.mode === '12h') {
|
|
3213
|
+
this.convertIfOver12Hours();
|
|
3211
3214
|
this.activeSegment = 'ampm';
|
|
3215
|
+
}
|
|
3212
3216
|
else
|
|
3213
3217
|
this.deactivate();
|
|
3214
3218
|
}
|
|
@@ -3217,6 +3221,15 @@ class TimeInputComponent {
|
|
|
3217
3221
|
}
|
|
3218
3222
|
this.emitControlValue();
|
|
3219
3223
|
}
|
|
3224
|
+
convertIfOver12Hours() {
|
|
3225
|
+
if (this.hours === '--')
|
|
3226
|
+
return;
|
|
3227
|
+
const h = parseInt(this.hours, 10);
|
|
3228
|
+
if (h > 12) {
|
|
3229
|
+
this.hours = String(h - 12).padStart(2, '0');
|
|
3230
|
+
this.amPm = 'PM';
|
|
3231
|
+
}
|
|
3232
|
+
}
|
|
3220
3233
|
adjustMinutes(delta) {
|
|
3221
3234
|
const current = this.minutes === '--' ? 0 : parseInt(this.minutes, 10);
|
|
3222
3235
|
let next = current + delta;
|