时间格式化工具支持自定义设置单位

This commit is contained in:
Looly 2024-06-17 15:39:23 +08:00
parent 47872765e3
commit 40c2b3ff87

View File

@ -155,10 +155,8 @@ public class BetweenFormatter implements Serializable {
if (StrUtil.isEmpty(sb)) {
sb.append(0).append(levelFormatter.apply(this.level));
} else {
if (StrUtil.isNotEmpty(separator)) {
sb.delete(sb.length() - separator.length(), sb.length());
}
} else if(StrUtil.isNotEmpty(separator)) {
sb.delete(sb.length() - separator.length(), sb.length());
}
// 自定义实现最后可能存在空格
return sb.toString().trim();