时间问题修复

This commit is contained in:
jinyuera
2021-12-05 17:54:58 +08:00
parent 0761fbd2d3
commit 8e5788d6df
4 changed files with 14 additions and 14 deletions

View File

@@ -27,17 +27,18 @@ public class TimeUtils {
} else if (span < TimeConstants.DAY) {
return String.format(Locale.getDefault(), "%d小时前", span / TimeConstants.HOUR);
} else if (span < TimeConstants.MONTH) {
if (span / TimeConstants.DAY >= 7) {
SimpleDateFormat sdr = new SimpleDateFormat("MM-dd",
Locale.CHINA);
return sdr.format(millis);
} else {
String format = String.format(Locale.getDefault(), "%d天前", span / TimeConstants.DAY);
// if (span / TimeConstants.DAY >= 7) {
// SimpleDateFormat sdr = new SimpleDateFormat("MM-dd",
// Locale.CHINA);
// return sdr.format(millis);
// } else {
//
//
// }
String format = String.format(Locale.getDefault(), "%d天前", span / TimeConstants.DAY);
Log.e("format",format);
return format;
}
Log.e("format",format);
return format;
} else if (span < TimeConstants.YEAR) {
SimpleDateFormat sdr;
if (span / TimeConstants.MONTH >= 6) {