mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-30 11:19:52 +08:00
fix bug
当传入time为null时,前端浏览器渲染报错
This commit is contained in:
parent
188ff03a28
commit
95ee04326a
@ -9,12 +9,12 @@
|
||||
* @returns {string | null}
|
||||
*/
|
||||
export function parseTime(time, cFormat) {
|
||||
if (arguments.length === 0) {
|
||||
if (arguments.length === 0 && time != null) {
|
||||
return null
|
||||
}
|
||||
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||
let date
|
||||
if (typeof time === 'object' && time != null) {
|
||||
if (typeof time === 'object') {
|
||||
date = time
|
||||
} else {
|
||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user