mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
18 lines
523 B
CoffeeScript
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
|
|
)
|
|
] |