一、前端書寫前端
<input type="date" ng-model="addForm.birthday" placeholder="" class="input-medium" value="2016-08-31"/>json
二、給控件日期格式化orm
$scope.alterForm.birthday=new Date($scope.alterForm.birthday);對象
三、對象轉json時,日期格式化get
1)在對象中input
@JSONField(format="yyyy-MM-dd")
private Date birthday;
2)在領域服務層查詢form
List<Customer> list = custService.search(customer);
String Array =JSONArray.toJSONString(list);
return Array;class
查詢單個時date
Customer cust = custService.getById(id);
String result = JSONObject.toJSONString(cust);
return result;List
則產生的日期是格式化好以後的日期格式