angular-datepicker icon indicating copy to clipboard operation
angular-datepicker copied to clipboard

Issue when I try to input a date manually.

Open eduardonaguiar opened this issue 8 years ago • 2 comments

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?

eduardonaguiar avatar May 25 '16 21:05 eduardonaguiar

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.

ahmadhsalim avatar Jun 10 '16 19:06 ahmadhsalim

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');

shivasingh0101 avatar Jun 29 '16 11:06 shivasingh0101