经常使用控件--日期

一、前端书写前端

<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

则产生的日期是格式化好以后的日期格式

相关文章
相关标签/搜索