|
@@ -16,7 +16,10 @@ const formatNumber = n => {
|
|
|
|
|
|
|
|
// 计算时间差
|
|
// 计算时间差
|
|
|
const handleDate = date => {
|
|
const handleDate = date => {
|
|
|
- const diffValue = new Date().getTime() - new Date(date).getTime()
|
|
|
|
|
|
|
+ if (typeof date === 'string') {
|
|
|
|
|
+ date = new Date(date)
|
|
|
|
|
+ }
|
|
|
|
|
+ const diffValue = new Date().getTime() - date.getTime()
|
|
|
if (diffValue < 0) {
|
|
if (diffValue < 0) {
|
|
|
console.log('时间不同步')
|
|
console.log('时间不同步')
|
|
|
return '刚刚'
|
|
return '刚刚'
|