I am using this library. I am having trouble converting the date format. When I pick a new date it should display date in dd/mm/yyyy
Asked
Active
Viewed 4,990 times
0
-
what you have tried? – Banik Feb 24 '16 at 07:43
-
I've tried writing ui-date-format="DD, d MM, yy" in directive element but not working – John Feb 24 '16 at 07:44
-
try ui-date-format="dd/mm/yyyy" and see what happens. – Banik Feb 24 '16 at 07:46
-
nothing happened ..it is still the same – John Feb 29 '16 at 06:48
1 Answers
2
<input type="text" ui-date-format="dd/mm/yy" .../>
EDIT:
If you want the date on the input to appear in dd/mm/yy
format as well, you need to init dateOptions
with the format:
$scope.dateOptions = {
dateFormat: 'dd/mm/yy',
}
And HTML:
<input type="text" ui-date-format="dd/mm/yy" ng-model="ngModel" ui-date="dateOptions"/>

Daniel
- 6,194
- 7
- 33
- 59
-
1But I want the date selected should appear in dd/mm/yyyy format in textbox itself – John Feb 29 '16 at 06:43