Commit 6b1e2aae by 胡悦

添加时间格式

1 parent e8eebc08
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-11-08 10:23:20 * @Date: 2022-11-08 10:23:20
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-11-09 15:09:29 * @LastEditTime: 2022-11-09 16:42:11
*/ */
// The Vue build version to load with the `import` command // The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias. // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
...@@ -78,6 +78,23 @@ var mixin = { ...@@ -78,6 +78,23 @@ var mixin = {
} }
} }
} }
Date.prototype.format = function (fmt) {
let o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
//季度
"q+": Math.floor((this.getMonth() + 3) / 3),
"S": this.getMilliseconds() //毫秒
}
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length))
for (let k in o) {
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)))
}
return fmt
}
const URL = const URL =
'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config' 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
const getConfig = (url = URL + '/record-config') => { const getConfig = (url = URL + '/record-config') => {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-11-08 10:38:40 * @Date: 2022-11-08 10:38:40
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-11-09 16:12:42 * @LastEditTime: 2022-11-09 16:43:50
--> -->
<template> <template>
<div class="table-box"> <div class="table-box">
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
formatter: cellValue => { formatter: cellValue => {
if (cellValue.createTime) { if (cellValue.createTime) {
return new Date(cellValue.createTime).format( return new Date(cellValue.createTime).format(
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd hh:mm:ss'
) )
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!