aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-17 12:32:53 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-17 12:32:53 +0200
commit86777a6f592b7b9a97d6a1491296c044c8942104 (patch)
treed0f97a62b33a8b12f70a12383863558be4025cd6
parent61a018ba4e1a3cfa249c4809262f607820b3f811 (diff)
downloadskyhanni-86777a6f592b7b9a97d6a1491296c044c8942104.tar.gz
skyhanni-86777a6f592b7b9a97d6a1491296c044c8942104.tar.bz2
skyhanni-86777a6f592b7b9a97d6a1491296c044c8942104.zip
made SkyBlockTime.formatted() the way it always was intended to work
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
index 72fa3d303..355473c9e 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
@@ -109,18 +109,17 @@ object LorenzUtils {
fun SimpleDateFormat.formatCurrentTime(): String = this.format(System.currentTimeMillis())
fun SkyBlockTime.formatted(): String {
- val date = SkyBlockTime.now()
- val hour = if (date.hour > 12) date.hour - 12 else date.hour
- val timeOfDay = if (date.hour > 11) "pm" else "am" // hooray for 12-hour clocks
- var minute = date.minute.toString()
+ val hour = if (this.hour > 12) this.hour - 12 else this.hour
+ val timeOfDay = if (this.hour > 11) "pm" else "am" // hooray for 12-hour clocks
+ var minute = this.minute.toString()
if (minute.length != 2) {
minute = minute.padStart(2, '0')
}
- val month = SkyBlockTime.monthName(date.month)
- val day = date.day
+ val month = SkyBlockTime.monthName(this.month)
+ val day = this.day
val daySuffix = SkyBlockTime.daySuffix(day)
- val year = date.year
+ val year = this.year
return "$month $day$daySuffix, Year $year $hour:${minute}$timeOfDay" // Early Winter 1st Year 300, 12:03pm
}