1:完成挚友功能
2:添加在送特定礼物展示弹框功能 3:修改部分图片格式变成wedp 4:用户主页添加礼物墙和挚友
This commit is contained in:
@@ -237,4 +237,25 @@ public class TimeUtils {
|
||||
|
||||
return sb.toString().trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化时长(毫秒),只返回天数部分。
|
||||
* 例如:输入 90000000 (90,000秒,即1天多),返回 "1天"
|
||||
*
|
||||
* @param durationMs 时长,单位为毫秒
|
||||
* @return 格式化后的天数字符串,如 "1天",如果不足一天则返回空字符串 ""
|
||||
*/
|
||||
public static String formatDurationDaysOnly(long durationMs) {
|
||||
long totalSeconds = durationMs / 1000;
|
||||
long days = totalSeconds / 86400;
|
||||
|
||||
// 如果天数大于0,则构建返回字符串
|
||||
if (days > 0) {
|
||||
return days + "天";
|
||||
}
|
||||
|
||||
// 如果天数不足1天,根据需求可以返回空字符串,也可以返回 "0天" 或其他
|
||||
return ""; // 或者 return "0天";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user