时间问题修复
This commit is contained in:
parent
e55fde5a05
commit
c2b2417ac8
|
@ -39,7 +39,7 @@ public interface Timing {
|
|||
}
|
||||
return StringUtils.joinWith(":", StringUtils.leftPad(String.valueOf(hour), 2, "0"),
|
||||
StringUtils.leftPad(String.valueOf(minute), 2, "0"),
|
||||
StringUtils.leftPad(String.valueOf(minute), 2, "0"));
|
||||
StringUtils.leftPad(String.valueOf(second), 2, "0"));
|
||||
}
|
||||
|
||||
default String timerValidate(String time, String name) {
|
||||
|
@ -91,9 +91,7 @@ public interface Timing {
|
|||
String[] values = StringUtils.split(stringTime, ":");
|
||||
int hours = 0, minutes = 0, seconds = 0;
|
||||
switch (values.length) {
|
||||
case 1 -> {
|
||||
hours = Integer.parseInt(values[0]);
|
||||
}
|
||||
case 1 -> hours = Integer.parseInt(values[0]);
|
||||
case 2 -> {
|
||||
hours = Integer.parseInt(values[0]);
|
||||
minutes = Integer.parseInt(values[1]);
|
||||
|
|
Loading…
Reference in New Issue