问题
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
回答1:
<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"/>
updated fiddle
来源:https://stackoverflow.com/questions/35595949/how-to-change-date-format-from-mm-dd-yyyy-to-dd-mm-yyyy