mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 13:43:09 +00:00
[Time Conductor] Validate start/end times
This commit is contained in:
parent
e5cf419697
commit
5b0c0e1278
@ -25,7 +25,7 @@
|
|||||||
<span class="l-time-range-inputs-elem ui-symbol type-icon">C</span>
|
<span class="l-time-range-inputs-elem ui-symbol type-icon">C</span>
|
||||||
<span class="l-time-range-input">
|
<span class="l-time-range-input">
|
||||||
<mct-control key="'datetime-field'"
|
<mct-control key="'datetime-field'"
|
||||||
structure="{ format: parameters.format }"
|
structure="{ format: parameters.format, validate: validateStart }"
|
||||||
ng-model="formModel"
|
ng-model="formModel"
|
||||||
ng-blur="updateBoundsFromForm()"
|
ng-blur="updateBoundsFromForm()"
|
||||||
field="'start'"
|
field="'start'"
|
||||||
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
<span class="l-time-range-input" ng-controller="ToggleController as t2">
|
<span class="l-time-range-input" ng-controller="ToggleController as t2">
|
||||||
<mct-control key="'datetime-field'"
|
<mct-control key="'datetime-field'"
|
||||||
structure="{ format: parameters.format }"
|
structure="{ format: parameters.format, validate: validateEnd }"
|
||||||
ng-model="formModel"
|
ng-model="formModel"
|
||||||
ng-blur="updateBoundsFromForm()"
|
ng-blur="updateBoundsFromForm()"
|
||||||
field="'end'"
|
field="'end'"
|
||||||
|
@ -240,6 +240,14 @@ define(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function validateStart(startValue) {
|
||||||
|
return startValue <= $scope.ngModel.outer.end - outerMinimumSpan;
|
||||||
|
}
|
||||||
|
|
||||||
|
function validateEnd(endValue) {
|
||||||
|
return endValue >= $scope.ngModel.outer.start + outerMinimumSpan;
|
||||||
|
}
|
||||||
|
|
||||||
$scope.startLeftDrag = startLeftDrag;
|
$scope.startLeftDrag = startLeftDrag;
|
||||||
$scope.startRightDrag = startRightDrag;
|
$scope.startRightDrag = startRightDrag;
|
||||||
$scope.startMiddleDrag = startMiddleDrag;
|
$scope.startMiddleDrag = startMiddleDrag;
|
||||||
@ -249,6 +257,9 @@ define(
|
|||||||
|
|
||||||
$scope.updateBoundsFromForm = updateBoundsFromForm;
|
$scope.updateBoundsFromForm = updateBoundsFromForm;
|
||||||
|
|
||||||
|
$scope.validateStart = validateStart;
|
||||||
|
$scope.validateEnd = validateEnd;
|
||||||
|
|
||||||
$scope.ticks = [];
|
$scope.ticks = [];
|
||||||
|
|
||||||
// Initialize scope to defaults
|
// Initialize scope to defaults
|
||||||
|
Loading…
Reference in New Issue
Block a user