aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt
index 33a9bbe83..3a32b3de6 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt
@@ -74,7 +74,7 @@ object TimeUtils {
}
// TODO: use kotlin Duration
- fun getMillis(string: String) = getMillis_(string.replace("m", "m ").replace(" ", " "))
+ fun getMillis(string: String) = getMillis_(string.replace("m", "m ").replace(" ", " ").trim())
private fun getMillis_(string: String) = pattern.matchMatcher(string.lowercase().trim()) {
val years = group("y")?.toLong() ?: 0L
@@ -148,4 +148,4 @@ enum class TimeUnit(val factor: Long, val shortName: String, val longName: Strin
MINUTE(FACTOR_MINUTES, "m", "Minute"),
SECOND(FACTOR_SECONDS, "s", "Second"),
;
-} \ No newline at end of file
+}