This should fix all the formatting issues

This commit is contained in:
NovaFox161
2021-11-20 01:55:51 -06:00
parent 3e1995d5e1
commit c0b8b7efc0
3 changed files with 15 additions and 11 deletions
@@ -53,12 +53,15 @@ object CalendarEmbed : EmbedMaker {
// Show events
events.forEach { date ->
val fieldTitle = date.key.toInstant().humanReadableDate(calendar.timezone, settings.timeFormat)
val content = StringBuilder()
date.value.forEach {
content.append("```\n")
.append(it.start.humanReadableTime(it.timezone, settings.timeFormat))
val title = date.key.toInstant().humanReadableDate(calendar.timezone, settings.timeFormat, true)
// sort events
val sortedEvents = date.value.sortedBy { it.start }
val content = StringBuilder().append("```\n")
sortedEvents.forEach {
content.append(it.start.humanReadableTime(it.timezone, settings.timeFormat))
.append(" - ")
.append(it.end.humanReadableTime(it.timezone, settings.timeFormat))
.append(" | ")
@@ -68,7 +71,7 @@ object CalendarEmbed : EmbedMaker {
}
content.append("```")
builder.addField(fieldTitle, content.toString(), false)
builder.addField(title, content.toString(), false)
}