fix for datepicker

Ran into an issue with bs-datepicker and $digest already in progress on scope.$apply - added a minor fix to make sure the error doesn't occur.