fix broken limit check

This commit is contained in:
David Tsay 2025-03-31 13:24:22 -07:00
parent e25bfb7291
commit 1d655e5ccf
2 changed files with 10 additions and 3 deletions

View File

@ -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}` };

View File

@ -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;