Open nkatevarapu opened 10 years ago
i changed the directive code from :
element.datepicker(scope.ngOptions).on('changeDate', function(e) {
var defaultFormat, defaultLanguage, format, language;
defaultFormat = $.fn.datepicker.defaults.format;
format = scope.ngOptions.format || defaultFormat;
defaultLanguage = $.fn.datepicker.defaults.language;
language = scope.ngOptions.language || defaultLanguage;
return scope.$apply(function() {
return scope.ngModel = $.fn.datepicker.DPGlobal.formatDate(e.date, format, language);
});
});
to element.datepicker(scope.ngOptions)
it seems resolving the problem. no more event bubbling nor changing the date value.
i'm not that sure that's the best solution, but in my case, it fixed it.
@hatemzidi thank you very much! it works well~~~
but what does this line of code used to do?
Please see my answer on issue https://github.com/cletourneau/angular-bootstrap-datepicker/issues/5#issuecomment-207871287
Version 2.0 When we select date from date picker today's date is not getting populating,yesterday day is populating