benzen / angular-bootstrap3-datepicker

A Simple datepicker directive based on bootstrap3-datetimepicker
Apache License 2.0
19 stars 24 forks source link

How to set date via model variable #16

Open iplan72014 opened 9 years ago

iplan72014 commented 9 years ago

Calendar popup didn't update months while data loaded at initially.

                  <datepickerstefan  id="date2" data-ng-model="date2" language="en-ca" date-format="YYYY-MM-DD" />
                 app.controller('AppCtrl', function ($scope) {
                                $scope.date2 = "01-Jan-2015";
                    });

While click the calendar icon -> current date(August- month) gets opened in calendar popup instead of January month.[$scope.date2 = "01-Jan-2015";].

Refer stackoverflow link for details explanation: http://stackoverflow.com/questions/32071902/angular-bootstrap3-datepicker-calendar-popup-didnt-update-while-pageloading/32072413#32072413

benzen commented 9 years ago

I think it's due to the date format that is not respected by the date you set. Also i think, but i m not sure, that the date should be a date object