From 6274587e5244072ebcbea29230de0c5547437d98 Mon Sep 17 00:00:00 2001 From: "[caserKing]" <[wkx12138@126.com]> Date: Mon, 6 Jul 2020 17:01:23 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=85=AC=E5=85=B1=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=91=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E3=80=90=E5=88=A4=E5=AE=9A=E6=97=B6=E9=97=B4=E6=88=B3=E4=B8=BA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E8=BF=98=E6=98=AF=E6=95=B0=E5=AD=97=E5=A4=84?= =?UTF-8?q?=E7=90=86=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/util.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/util.js b/utils/util.js index 151cff5..1cd01d4 100644 --- a/utils/util.js +++ b/utils/util.js @@ -35,6 +35,9 @@ const formatTime = (date, fmt) => { if (!date) { return date; } + if (typeof date === 'string' && date.length === 13) { + date = Number(date); + } if (typeof date == "number") { date = new Date(date); } @@ -92,6 +95,9 @@ function qrc(id, code, width, height) { }); } function fmtDate(obj) { + if (typeof obj === 'string' && obj.length === 13) { + obj = Number(obj); + } var date = new Date(obj); var y = 1900 + date.getYear(); var m = "0" + (date.getMonth() + 1);