cletourneau / angular-bootstrap-datepicker

Apache License 2.0
35 stars 56 forks source link

angular-bootstrap-datepicker #6

Open nkatevarapu opened 10 years ago

nkatevarapu commented 10 years ago

Version 2.0 When we select date from date picker today's date is not getting populating,yesterday day is populating

hatemzidi commented 9 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.

flyher commented 9 years ago

@hatemzidi thank you very much! it works well~~~

but what does this line of code used to do?

fkammer commented 8 years ago

Please see my answer on issue https://github.com/cletourneau/angular-bootstrap-datepicker/issues/5#issuecomment-207871287

fkammer commented 8 years ago

@nkatevarapu @hatemzidi @flyher I started a new repository wich fixes this bug (and a few more). More infos here #17 and here.