mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Throught the plugin: https://github.com/jcsmorais/shortcut-buttons-flatpickr import js library via yarn
12 lines
495 B
CoffeeScript
12 lines
495 B
CoffeeScript
angular.module("admin.utils").directive "datepicker", ($window, $timeout) ->
|
|
require: "ngModel"
|
|
link: (scope, element, attrs, ngModel) ->
|
|
$timeout ->
|
|
flatpickr(element, Object.assign(
|
|
{},
|
|
$window.FLATPICKR_DATE_DEFAULT, {
|
|
onOpen: (selectedDates, dateStr, instance) ->
|
|
instance.setDate(ngModel.$modelValue)
|
|
}
|
|
));
|