forked from LogBlock/LogBlock
Fixed timespec parsing to work with single numbers
This commit is contained in:
@@ -75,6 +75,8 @@ public class Utils
|
|||||||
public static int parseTimeSpec(String[] spec) {
|
public static int parseTimeSpec(String[] spec) {
|
||||||
if (spec == null || spec.length < 1 || spec.length > 2)
|
if (spec == null || spec.length < 1 || spec.length > 2)
|
||||||
return -1;
|
return -1;
|
||||||
|
if (spec.length == 1 && isInt(spec[0]))
|
||||||
|
return Integer.valueOf(spec[0]);
|
||||||
if (!spec[0].contains(":") && !spec[0].contains("."))
|
if (!spec[0].contains(":") && !spec[0].contains("."))
|
||||||
if (spec.length == 2) {
|
if (spec.length == 2) {
|
||||||
if (!isInt(spec[0]))
|
if (!isInt(spec[0]))
|
||||||
|
Reference in New Issue
Block a user