app.directive('jqdatepicker', function() { return { restrict : 'A', require : 'ngModel', link : function(scope, element, attrs, ngModelCtrl) { $(function() { element.datepicker({ dateFormat : 'dd-M-yy', maxDate : "Now", changeYear : true, yearRange : "-100:+100", showButtonPanel : true, closeText : 'Clear', onClose : function(date, inst) { if ($(window.event.srcElement).hasClass( 'ui-datepicker-close')) { document.getElementById(this.id).value = ''; } }, onSelect : function(date) { scope.$apply(function() { ngModelCtrl.$setViewValue(date); }); } }); }); } } });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)