Add configurable timestamp date and clock formats

This commit is contained in:
ajp_anton
2026-07-27 22:06:47 +00:00
parent 125ba99af9
commit 6116c13e00
9 changed files with 173 additions and 66 deletions
@@ -7,6 +7,9 @@ import org.junit.Test
import se.ajpanton.notificationlog.model.NotificationAction
import se.ajpanton.notificationlog.model.NotificationLogEntry
import se.ajpanton.notificationlog.settings.LogViewSettings
import se.ajpanton.notificationlog.settings.TimestampClockFormat
import se.ajpanton.notificationlog.settings.TimestampDateFormat
import se.ajpanton.notificationlog.settings.TimestampZone
class LogExporterTest {
private val imageEntry = NotificationLogEntry(
@@ -51,4 +54,14 @@ class LogExporterTest {
assertEquals(LogExporter.formatted(listOf(imageEntry), settings), formatted)
assertEquals(LogExporter.html(listOf(imageEntry), settings) { "images/${it.imageId}.png" }, html)
}
@Test fun `exports use the configured timestamp date and clock formats`() {
val settings = LogViewSettings(
timestampZone = TimestampZone.UTC,
timestampDateFormat = TimestampDateFormat.YEAR_MONTH_DAY,
timestampClockFormat = TimestampClockFormat.HOUR_24,
)
assertTrue(LogExporter.csv(listOf(imageEntry), settings).contains("1970-01-01 00:00:00"))
}
}