X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetStatusAjaxPage.kt;h=9872d1e79e1d855b69fc4dd346d786dae74b51a8;hp=05a69d7b57b68e65e62014720deb5c3ab7b463af;hb=40998dc856efb0df91f669c6dff1b829d573a54a;hpb=d5bf199171aa509d295985453db0cc130c3665a8 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.kt index 05a69d7..9872d1e 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.kt @@ -16,15 +16,18 @@ import net.pterodactylus.sone.utils.toArray import net.pterodactylus.sone.web.WebInterface import net.pterodactylus.sone.web.page.FreenetRequest import java.text.SimpleDateFormat +import java.util.TimeZone /** * The “get status” AJAX handler returns all information that is necessary to * update the web interface in real-time. */ -class GetStatusAjaxPage(webInterface: WebInterface, private val elementLoader: ElementLoader, private val timeTextConverter: TimeTextConverter, private val l10nFilter: L10nFilter): +class GetStatusAjaxPage(webInterface: WebInterface, private val elementLoader: ElementLoader, private val timeTextConverter: TimeTextConverter, private val l10nFilter: L10nFilter, timeZone: TimeZone = TimeZone.getDefault()): JsonPage("getStatus.ajax", webInterface) { - private val dateFormatter = SimpleDateFormat("MMM d, yyyy, HH:mm:ss") + private val dateFormatter = SimpleDateFormat("MMM d, yyyy, HH:mm:ss").apply { + this.timeZone = timeZone + } override fun createJsonObject(request: FreenetRequest) = (webInterface.getCurrentSoneWithoutCreatingSession(request.toadletContext) as Sone?).let { currentSone ->