From 1d655e5ccfff03b4373f3746bfebe5335fb52a73 Mon Sep 17 00:00:00 2001 From: David Tsay Date: Mon, 31 Mar 2025 13:24:22 -0700 Subject: [PATCH] fix broken limit check --- src/plugins/timeConductor/DateTimePopupFixed.vue | 2 +- src/plugins/timeConductor/TimePopupFixed.vue | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/plugins/timeConductor/DateTimePopupFixed.vue b/src/plugins/timeConductor/DateTimePopupFixed.vue index 16a546de44..70f8131254 100644 --- a/src/plugins/timeConductor/DateTimePopupFixed.vue +++ b/src/plugins/timeConductor/DateTimePopupFixed.vue @@ -240,7 +240,7 @@ export default { this.clearAllValidation(); const inputType = refName.includes('Date') ? 'Date' : 'Time'; - const formatter = inputType === 'Date' ? this.timeFormatter : this.durationFormatter; + const formatter = inputType === 'Date' ? this.timeSystemFormatter : this.durationFormatter; const validationResult = formatter.validate(this.formattedBounds[refName]) ? { valid: true } : { valid: false, message: `Invalid ${inputType}` }; diff --git a/src/plugins/timeConductor/TimePopupFixed.vue b/src/plugins/timeConductor/TimePopupFixed.vue index 591bb3fa48..800a57d29c 100644 --- a/src/plugins/timeConductor/TimePopupFixed.vue +++ b/src/plugins/timeConductor/TimePopupFixed.vue @@ -94,6 +94,7 @@ export default { }, inject: [ 'openmct', + 'configuration', 'isTimeSystemUTCBased', 'timeContext', 'timeSystemKey', @@ -176,9 +177,10 @@ export default { }, handleFormSubmission(shouldDismiss) { this.validateLimit(); - this.reportValidity('limit'); this.validateBounds(); this.reportValidity('bounds'); + // report on this custom validity check last after more basic checks + this.reportValidity('limit'); if (this.isValid) { this.setBoundsFromView(shouldDismiss); @@ -201,7 +203,12 @@ export default { this.logicalValidityMap.bounds = this.timeContext.validateBounds(bounds); }, - validateLimit(bounds) { + validateLimit() { + const bounds = { + start: this.timeSystemFormatter.parse(this.formattedBounds.start), + end: this.timeSystemFormatter.parse(this.formattedBounds.end) + }; + const limit = this.configuration?.menuOptions ?.filter((option) => option.timeSystem === this.timeSystemKey) ?.find((option) => option.limit)?.limit;