How to change date format from mm/dd/yyyy to dd/mm/yyyy?

杀马特。学长 韩版系。学妹 提交于 2020-01-17 05:07:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!