-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathangular-schema-form-datefields.js
More file actions
28 lines (26 loc) · 2.27 KB
/
angular-schema-form-datefields.js
File metadata and controls
28 lines (26 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
angular.module("schemaForm").run(["$templateCache", function($templateCache) {$templateCache.put("directives/decorators/bootstrap/datefields/angular-schema-form-datefields.html","<div class=\"form-group schema-form-datefields\" ng-class=\"{ \'{{\'schema-form-\' + form.type}}\': true, \'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess(), \'has-feedback\': form.feedback !== false }\">\n <label class=\"control-label {{form.labelHtmlClass}}\" ng-show=\"showTitle()\">{{form.title}}</label>\n <div class=\"schema-form-datefields-container\">\n <ng-combo-date-picker \n schema-validate=\"form\"\n ng-model=\"$$value$$\" \n ng-placeholder=\"Year,Month,Date\" \n ng-required=\"{{form.schema.required}}\" \n ng-year-order=\"{{form.schema.yearOrder || \'desc\'}}\" \n ng-min-date=\"{{form.schema.minDate}}\" \n ng-max-date=\"{{form.schema.maxDate}}\" \n ng-order=\"{{(form.schema.order || \'mdy\')}}\"></ng-combo-date-picker>\n </div>\n <div class=\"help-block\" sf-message=\"form.description\"></div>\n</div>");}]);
angular.module('schemaForm').config(
['schemaFormProvider', 'schemaFormDecoratorsProvider', 'sfPathProvider',
function(schemaFormProvider, schemaFormDecoratorsProvider, sfPathProvider) {
var datefields = function(name, schema, options) {
if (schema.type === 'string' && schema.format === 'datefields') {
var f = schemaFormProvider.stdFormObj(name, schema, options);
f.key = options.path;
f.type = 'datefields';
options.lookup[sfPathProvider.stringify(options.path)] = f;
return f;
}
};
schemaFormProvider.defaults.string.unshift(datefields);
//Add to the bootstrap directive
schemaFormDecoratorsProvider.addMapping(
'bootstrapDecorator',
'datefields',
'directives/decorators/bootstrap/datefields/angular-schema-form-datefields.html'
);
schemaFormDecoratorsProvider.createDirective(
'datefields',
'directives/decorators/bootstrap/datefields/angular-schema-form-datefields.html'
);
}
]);