1. 程式人生 > >給datagrid的日期格式化成年月日

給datagrid的日期格式化成年月日

rem false data formatter mva fit idf func mon

$(‘#infos‘).datagrid({
            title:‘系統版本列表‘,
            iconCls:‘icon-view‘, 
            method:‘POST‘, 
            singleSelect:false, 
            fit : true, 
            border : true,
            fitColumns:true,
            striped: true, 
            collapsible:true, 
            url:mUrl.queryVersionByConditionPaging,
            sortName: 
‘versionId‘, sortOrder: ‘desc‘, remoteSort: true, idField:‘versionId‘, queryParams:{}, pagination:true, rownumbers:true, pageSize : 15, pageList : [15, 30, 45, 60, 75,90,100,150], frozenColumns:[[ {field:
‘ck‘,checkbox:true}, {title:‘versionId‘,field:‘versionId‘,width:10,sortable:true,hidden:true} ]], columns:[[ {field:‘productCode‘,title:‘產品編號‘,width:80}, {field:‘versionCode‘,title:‘版本編號‘,width:100}, {field:‘upgradeTime‘,title:‘升級時間‘,width:100, formatter :
function(value){ var date = new Date(value); var y = date.getFullYear(); var m = date.getMonth() + 1; var d = date.getDate(); return y + ‘-‘ +m + ‘-‘ + d; }}, {field:‘status‘,title:‘版本狀態‘,width:100, formatter:function(value){ <c:forEach var="dataDic" items="${requestScope.VERSION_TYPE}"> if(value==‘${dataDic.dicItemValue}‘){ return ‘${dataDic.dicItemName}‘; } </c:forEach> }}, {field:‘upgradeWay‘,title:‘升級方式‘,width:80, formatter:function(value){ <c:forEach var="dataDic" items="${requestScope.UPGRADEWAY_TYPE}"> if(value==‘${dataDic.dicItemValue}‘){ return ‘${dataDic.dicItemName}‘; } </c:forEach> }}, {field:‘createUser‘,title:‘創建人‘,width:150}, {field:‘createDate‘,title:‘創建時間‘,width:150} ]],

給datagrid的日期格式化成年月日