Files
openfoodnetwork/app/assets/javascripts/admin/shared_directives.js.coffee
2014-02-21 14:01:33 +11:00

18 lines
523 B
CoffeeScript

sharedDirectivesModule = angular.module("ofn.shared_directives", [])
sharedDirectivesModule.directive "datetimepicker", [
"$parse"
($parse) ->
return (
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
element.datetimepicker
dateFormat: "yy-mm-dd"
timeFormat: "HH:mm:ss"
stepMinute: 15
onSelect: (dateText, inst) ->
scope.$apply (scope) ->
# Fires ngModel.$parsers
ngModel.$setViewValue dateText
)
]