aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2')
-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
}