angular-datepicker
angular-datepicker copied to clipboard
Issue when I try to input a date manually.
I creating a GUI and need the user can input the date both manually and selecting a date in datepicker. When I input the date manually de modelview value isn't setted. How do I can make it?
I'm having the same issue. I set the format to be DD/MM/YYYY
. When the user enters a date manually using keyboard, say, 03/12/2016
and then I click the date picker it shows the date as march 12th instead of dec 3rd. But when I pick a date on the date picker it displays the properly formatted date in the input box.
It works on other date formats though.
In the respective js file provide a format of 'YYYY/MM/DD' because moment.js reads it as the format i mentioned.
The code is as follows:
<input type="text" ng-model="$scope.dob" date-time name="dob" format="DD-MM-YYYY" auto-close="true" min-view="date" view="year">
$scope.dob = moment($scope.dob, "DD/MM/YYYY").format('YYYY/MM/DD');