diff options
author | Empa <42304516+ItsEmpa@users.noreply.github.com> | 2024-08-26 11:27:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-26 11:27:58 +0200 |
commit | 81e8c4c0a62e1ad899a6fee612d8987814bb2c30 (patch) | |
tree | be35b0703bc8aa0614c3c899fbaea1520c91b681 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 35b1a6a1b83a1504605bd5b5d3e4f6fd6e545c8e (diff) | |
download | skyhanni-81e8c4c0a62e1ad899a6fee612d8987814bb2c30.tar.gz skyhanni-81e8c4c0a62e1ad899a6fee612d8987814bb2c30.tar.bz2 skyhanni-81e8c4c0a62e1ad899a6fee612d8987814bb2c30.zip |
Feature: Motes in Session (#2323)
Co-authored-by: ItsEmpa <itsempa@users.noreply.github.com>
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt index 4d7b7ad4d..201c294e5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt @@ -163,3 +163,8 @@ enum class TimeUnit(val factor: Long, val shortName: String, val longName: Strin fun format(value: Int, longFormat: Boolean = false) = value.addSeparators() + getName(value, longFormat) } + +val Duration.inPartialSeconds: Double get() = inWholeMilliseconds.toDouble() / 1000 +val Duration.inPartialMinutes: Double get() = inPartialSeconds / 60 +val Duration.inPartialHours: Double get() = inPartialSeconds / 3600 +val Duration.inPartialDays: Double get() = inPartialSeconds / 86_400 |