提交 4ee9324f 编写于 作者: guangjun.yang's avatar guangjun.yang

时间格式问题

上级 d839d84b
...@@ -235,9 +235,17 @@ export function convertTime(time, isToSlash = true) { ...@@ -235,9 +235,17 @@ export function convertTime(time, isToSlash = true) {
return '' return ''
} else { } else {
if(isToSlash) { if(isToSlash) {
return new Date( new Date(time)).format("yyyy/MM/dd hh:mm:ss"); if(typeof(time) == 'object') {
return time.format("yyyy/MM/dd hh:mm:ss");
} else {
return time.replace(/-/g, '/')
}
} else { } else {
return new Date( new Date(time)).format("yyyy-MM-dd hh:mm:ss"); if(typeof(time) == 'object') {
return time.format("yyyy-MM-dd hh:mm:ss");
} else {
return time.replace(/\//g, '-')
}
} }
} }
} }
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册