mirror of
https://gitee.com/jamen/slife.git
synced 2026-10-30 14:03:37 +00:00
format date
This commit is contained in:
@@ -39,7 +39,12 @@ function getcolumns() {
|
||||
},
|
||||
{
|
||||
field: 'deploymentTime',
|
||||
title: '部署时间'
|
||||
title: '部署时间',
|
||||
align: 'center',
|
||||
formatter: function (value, row, index) {
|
||||
var date = row.deploymentTime;
|
||||
return formatDate(new Date(date));
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
||||
@@ -90,11 +90,21 @@
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间'
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
formatter: function (value, row, index) {
|
||||
var date = row.createTime;
|
||||
return formatDate(new Date(date));
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'lastUpdateTime',
|
||||
title: '最后更新时间'
|
||||
title: '最后更新时间',
|
||||
align: 'center',
|
||||
formatter: function (value, row, index) {
|
||||
var date = row.lastUpdateTime;
|
||||
return formatDate(new Date(date));
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
||||
@@ -257,4 +257,19 @@ function dt_action(title, action) {
|
||||
area: ['800px', '520px'],
|
||||
content: url + action // iframe的url
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化日期
|
||||
* @param now
|
||||
* @returns {string}
|
||||
*/
|
||||
function formatDate(now) {
|
||||
var year = now.getFullYear();
|
||||
var month = now.getMonth()+1;
|
||||
var date = now.getDate();
|
||||
var hour = now.getHours();
|
||||
var minute = now.getMinutes();
|
||||
var second = now.getSeconds() > 10 ? now.getSeconds() : '0' + now.getSeconds();
|
||||
return year + "-" + month + "-" + date+ " " + hour + ":" + minute + ":" + second;
|
||||
}
|
||||
Reference in New Issue
Block a user