I am encountering an issue with the datepicker from Angular UI bootstrap. When I programmatically change the date, the view does not update accordingly. For example, if I switch from November 30th to December 2nd, the date changes but the view remains fixed in November. Below is the code snippet for the next date button function:
$scope.right=function(){
if($scope.viewmodel.timeResolution=='yearly')
$scope.dt.setFullYear($scope.dt.getFullYear()+1);
else if($scope.viewmodel.timeResolution=='monthly')
$scope.dt.setMonth($scope.dt.getMonth()+1);
else if($scope.viewmodel.timeResolution=='daily') {
$scope.dt.setDate($scope.dt.getDate() + 1);
}
$scope.changedValue();
};
HTML :
<uib-datepicker ng-model="dt" id="dp" datepicker-mode="mode" init-date="initDate" show-weeks=false max-mode="maxMode" min-date="minDate" max-date="maxDate" min-mode="minMode" class="well well-sm" ng-change="changedValue(viewmodel.dt)"></uib-datepicker>
How can I ensure that the view refreshes every time I programmatically change the date on the datepicker?