I am using angularjs, angular bootstap (this one) and their datepicker to enter date.
<input type="text" datepicker-popup="dd.mm.yyyy" ng-model="dt" datepicker-options="dateOptions" ng-required="true">
I want to be able to change date selected by datepicker manually. For example, I picked 07.09.2013 in datepicker and I want to change it to 07.09.2012. To do this, I click in my input and hit backspace to remove last digit 3 and put there 2. The problem is that when I do this, my ng-model becomes a string from a Date object and datepicker does not catch new date. You can try to do this on angular bootstap page (using firefox).
I understand that it is normal behavior because of input type text, which indicates browser that user can put there any text he want, and ng-model directive, because this is how it works. But is there a workaround for this problem? I thought that I need to monitor my ng-model using ng-change or $watch and convert it to a Date object using libraries mentioned here (I can't use Date.parse() because my date format is not valid for this function).
My question is: are there any different solution to this problem? Any config flags or something angular-specific?