[Forms] Date time controls

Implement date time controls up to the point that
they validate, and information (albeit not the right
information) propagates back up to the containing
form. WTD-530.
This commit is contained in:
Victor Woeltjen
2014-11-28 13:15:02 -08:00
parent bc3d1270d2
commit a464fee6df
3 changed files with 81 additions and 18 deletions

View File

@ -0,0 +1,34 @@
/*global define*/
define(
[],
function () {
function DateTimeController($scope) {
function update() {
var date = $scope.datetime.date,
hour = $scope.datetime.hour,
min = $scope.datetime.min,
sec = $scope.datetime.sec;
$scope.ngModel[$scope.field] = [
date,
hour,
min,
sec
].join(".");
}
$scope.$watch("datetime.date", update);
$scope.$watch("datetime.hour", update);
$scope.$watch("datetime.min", update);
$scope.$watch("datetime.sec", update);
$scope.datetime = {};
}
return DateTimeController;
}
);