mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Remove datepicker instance
This commit is contained in:
committed by
Konrad
parent
6b7030a6a8
commit
c6332ab306
@@ -1,14 +0,0 @@
|
||||
angular.module("admin.utils").directive "datepicker", ($window, $timeout) ->
|
||||
require: "ngModel"
|
||||
link: (scope, element, attrs, ngModel) ->
|
||||
$timeout ->
|
||||
flapickrInstance = flatpickr(element, Object.assign(
|
||||
{},
|
||||
$window.FLATPICKR_DATE_DEFAULT, {
|
||||
onOpen: (selectedDates, dateStr, instance) ->
|
||||
instance.setDate(ngModel.$modelValue)
|
||||
}
|
||||
));
|
||||
ngModel.$render = () ->
|
||||
newValue = ngModel.$viewValue;
|
||||
flapickrInstance?.setDate(newValue)
|
||||
Reference in New Issue
Block a user