UNPKG

zettapi_client

Version:

Admin panel and client-side CRUD operations in angular to use with zettapi_server rest api to get started quickly in any CMS project.

17 lines 511 B
app.directive('asDate', function() { return { require: '^ngModel', restrict: 'A', link: function(scope, element, attrs, ctrl) { ctrl.$formatters.splice(0, ctrl.$formatters.length); ctrl.$parsers.splice(0, ctrl.$parsers.length); ctrl.$formatters.push(function(modelValue) { if (!modelValue) return; return new Date(modelValue).toISOString().slice(0, 10); }); ctrl.$parsers.push(function(modelValue) { return modelValue; }); } }; });