GUAC-1213: Add date and time fields, along with corresponding template/controller stubs.

This commit is contained in:
Michael Jumper
2015-08-10 10:04:14 -07:00
parent 225297746d
commit 2e52382fd9
10 changed files with 230 additions and 20 deletions

View File

@@ -0,0 +1,32 @@
/*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Controller for date fields.
*/
angular.module('form').controller('dateFieldController', ['$scope',
function dateFieldController($scope) {
/* STUB */
}]);

View File

@@ -0,0 +1,32 @@
/*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Controller for time fields.
*/
angular.module('form').controller('timeFieldController', ['$scope',
function timeFieldController($scope) {
/* STUB */
}]);

View File

@@ -131,6 +131,30 @@ angular.module('form').provider('formService', function formServiceProvider() {
module : 'form',
controller : 'timeZoneFieldController',
templateUrl : 'app/form/templates/timeZoneField.html'
},
/**
* Field type which allows selection of individual dates.
*
* @see {@link Field.Type.DATE}
* @type FieldType
*/
'DATE' : {
module : 'form',
controller : 'dateFieldController',
templateUrl : 'app/form/templates/dateField.html'
},
/**
* Field type which allows selection of times of day.
*
* @see {@link Field.Type.TIME}
* @type FieldType
*/
'TIME' : {
module : 'form',
controller : 'timeFieldController',
templateUrl : 'app/form/templates/timeField.html'
}
};

View File

@@ -0,0 +1,3 @@
<div class="date-field">
<input type="text" ng-model="model" autocorrect="off" autocapitalize="off"/>
</div>

View File

@@ -0,0 +1,3 @@
<div class="time-field">
<input type="text" ng-model="model" autocorrect="off" autocapitalize="off"/>
</div>

View File

@@ -138,7 +138,24 @@ angular.module('rest').factory('Field', [function defineField() {
*
* @type String
*/
TIMEZONE : "TIMEZONE"
TIMEZONE : "TIMEZONE",
/**
* The type string associated with parameters that may contain dates.
* The format of the date is standardized as YYYY-MM-DD, zero-padded.
*
* @type String
*/
DATE : "DATE",
/**
* The type string associated with parameters that may contain times.
* The format of the time is stnadardized as HH:MM:DD, zero-padded,
* 24-hour.
*
* @type String
*/
TIME : "TIME"
};