From 23d1f9aa12c32f00304419b106c696ff7670dd99 Mon Sep 17 00:00:00 2001 From: mutoe Date: Tue, 21 Aug 2018 15:17:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(profile):=20=E4=BF=AE=E5=A4=8D=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=BB=E9=A1=B5=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/filters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filters.js b/src/filters.js index 8d660f7b..0afd2a98 100644 --- a/src/filters.js +++ b/src/filters.js @@ -69,7 +69,7 @@ export function formatDate(date, fmt = "yyyy/MM/dd hh:mm") { export const time2txt = str => { if (!str) return ""; // 兼容 IOS 保证传入数据格式 YYYY/MM/dd HH:mm:ss - let date = new Date(str.replace(/-/g, "/")); + let date = new Date(str); // 时间差 = 当前时间 - date (单位: 毫秒) let time = new Date() - date;