feat: app端推荐添加时间显示(测试)

This commit is contained in:
orz12
2024-09-08 22:18:06 +08:00
committed by bggRGjQaUbCoE
parent be8b301473
commit a4a1cb1371
3 changed files with 30 additions and 0 deletions

View File

@@ -167,6 +167,11 @@ class Utils {
return '${hour > 0 ? "${paddingStr(hour)}:" : ""}${paddingStr(minute)}:${paddingStr(second)}';
}
static String shortenChineseDateString(String date) {
if (date.contains("")) return '${date.split("").first}';
return date;
}
// 完全相对时间显示
static String formatTimestampToRelativeTime(timeStamp) {
var difference = DateTime.now()