mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
时间格式化工具支持自定义设置单位
This commit is contained in:
parent
47872765e3
commit
40c2b3ff87
@ -155,10 +155,8 @@ public class BetweenFormatter implements Serializable {
|
|||||||
|
|
||||||
if (StrUtil.isEmpty(sb)) {
|
if (StrUtil.isEmpty(sb)) {
|
||||||
sb.append(0).append(levelFormatter.apply(this.level));
|
sb.append(0).append(levelFormatter.apply(this.level));
|
||||||
} else {
|
} else if(StrUtil.isNotEmpty(separator)) {
|
||||||
if (StrUtil.isNotEmpty(separator)) {
|
sb.delete(sb.length() - separator.length(), sb.length());
|
||||||
sb.delete(sb.length() - separator.length(), sb.length());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 自定义实现最后可能存在空格
|
// 自定义实现最后可能存在空格
|
||||||
return sb.toString().trim();
|
return sb.toString().trim();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user