mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 00:20:44 +00:00
Add apache commons DurationFormatUtils
This commit is contained in:
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.time.DurationFormatUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import vg.civcraft.mc.civmodcore.chat.ChatUtils;
|
||||
|
||||
@@ -36,6 +37,14 @@ public class TextUtil {
|
||||
}
|
||||
return sb.toString().trim();
|
||||
}
|
||||
|
||||
public static String formatDurationWithFormat(long time, String format) {
|
||||
return formatDurationWithFormat(time, format, true);
|
||||
}
|
||||
|
||||
public static String formatDurationWithFormat(long time, String format, boolean padWithZeros) {
|
||||
return DurationFormatUtils.formatDuration(time, format, padWithZeros);
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// Paging and chrome-tools like titleize
|
||||
|
||||
Reference in New Issue
Block a user