diff --git a/slife-activiti/src/main/resources/static/model/process/processDefinition.js b/slife-activiti/src/main/resources/static/model/process/processDefinition.js index 1cf7641..848e66d 100644 --- a/slife-activiti/src/main/resources/static/model/process/processDefinition.js +++ b/slife-activiti/src/main/resources/static/model/process/processDefinition.js @@ -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: '操作', diff --git a/slife-activiti/src/main/resources/templates/model/list.ftl b/slife-activiti/src/main/resources/templates/model/list.ftl index e9dab62..eeb273b 100644 --- a/slife-activiti/src/main/resources/templates/model/list.ftl +++ b/slife-activiti/src/main/resources/templates/model/list.ftl @@ -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: '操作', diff --git a/slife-web/src/main/resources/static/js/slife/datatable.js b/slife-web/src/main/resources/static/js/slife/datatable.js index 9239e2d..08d8852 100644 --- a/slife-web/src/main/resources/static/js/slife/datatable.js +++ b/slife-web/src/main/resources/static/js/slife/datatable.js @@ -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; } \ No newline at end of file