111
This commit is contained in:
parent
1e18b587b2
commit
b5a8f0614f
@ -36,15 +36,15 @@ func TimeToAgoString(t time.Time) string {
|
|||||||
minutes := int(diffTime.Minutes())
|
minutes := int(diffTime.Minutes())
|
||||||
return fmt.Sprintf("%d分钟前", minutes)
|
return fmt.Sprintf("%d分钟前", minutes)
|
||||||
case diffTime < 24*time.Hour:
|
case diffTime < 24*time.Hour:
|
||||||
return "一小时前"
|
return "1小时前"
|
||||||
case diffTime < 48*time.Hour:
|
case diffTime < 48*time.Hour:
|
||||||
return "两天前"
|
return "2天前"
|
||||||
case diffTime < 72*time.Hour:
|
case diffTime < 72*time.Hour:
|
||||||
return "三天前"
|
return "3天前"
|
||||||
case diffTime < 10*time.Hour*24:
|
case diffTime < 10*time.Hour*24:
|
||||||
days := int(diffTime.Hours()) / 24
|
days := int(diffTime.Hours()) / 24
|
||||||
return fmt.Sprintf("%d天前", days)
|
return fmt.Sprintf("%d天前", days)
|
||||||
default:
|
default:
|
||||||
return "十天前"
|
return "10天前"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user