mirror of
https://github.com/nasa/openmct.git
synced 2025-06-01 23:20:50 +00:00
[Forms] Use MM-DD in date-time control
Use month and day instead of day-of-year in date-time control, WTD-1272.
This commit is contained in:
parent
0f30e5e840
commit
05a114cc75
@ -35,8 +35,8 @@
|
|||||||
<span class='field control date'>
|
<span class='field control date'>
|
||||||
<input type='text'
|
<input type='text'
|
||||||
name='date'
|
name='date'
|
||||||
placeholder="YYYY-DDD"
|
placeholder="{{format}}"
|
||||||
ng-pattern="/\d\d\d\d-\d\d\d/"
|
ng-pattern="/\d\d\d\d-\d\d-\d\d/"
|
||||||
ng-model='datetime.date'
|
ng-model='datetime.date'
|
||||||
ng-required='ngRequired || partiallyComplete'/>
|
ng-required='ngRequired || partiallyComplete'/>
|
||||||
</span>
|
</span>
|
||||||
@ -80,4 +80,4 @@
|
|||||||
</ng-form>
|
</ng-form>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -26,7 +26,7 @@ define(
|
|||||||
function () {
|
function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var DATE_FORMAT = "YYYY-DDD";
|
var DATE_FORMAT = "YYYY-MM-DD";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controller for the `datetime` form control.
|
* Controller for the `datetime` form control.
|
||||||
@ -92,6 +92,9 @@ define(
|
|||||||
$scope.$watch("datetime.min", update);
|
$scope.$watch("datetime.min", update);
|
||||||
$scope.$watch("datetime.sec", update);
|
$scope.$watch("datetime.sec", update);
|
||||||
|
|
||||||
|
// Expose format string for placeholder
|
||||||
|
$scope.format = DATE_FORMAT;
|
||||||
|
|
||||||
// Initialize forms values
|
// Initialize forms values
|
||||||
updateDateTime(
|
updateDateTime(
|
||||||
($scope.ngModel && $scope.field) ?
|
($scope.ngModel && $scope.field) ?
|
||||||
@ -102,4 +105,4 @@ define(
|
|||||||
return DateTimeController;
|
return DateTimeController;
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user