Copy datepicker directive to utils module

Ensures that datepicker is available for subscriptions
This commit is contained in:
Rob Harrington
2018-03-21 12:25:03 +11:00
committed by Maikel Linke
parent 386716088a
commit c77a01815c
2 changed files with 13 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
angular.module("admin.utils").directive "datepicker", ->
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
element.datepicker
dateFormat: "yy-mm-dd"
onSelect: (dateText, inst) ->
scope.$apply (scope) ->
# Fires ngModel.$parsers
ngModel.$setViewValue dateText