From cdfb8e377f1eeef86b89305e5d8ec7ccb50f44eb Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Tue, 17 Jan 2023 15:06:55 +0800 Subject: [PATCH] fix(api): some dates were not returned as UTC --- .../interfaces/api/rest/dto/AuthenticationActivityDto.kt | 3 ++- .../gotson/komga/interfaces/api/rest/dto/PageHashKnownDto.kt | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/AuthenticationActivityDto.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/AuthenticationActivityDto.kt index 943c5bed9..0fc6db3a4 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/AuthenticationActivityDto.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/AuthenticationActivityDto.kt @@ -2,6 +2,7 @@ package org.gotson.komga.interfaces.api.rest.dto import com.fasterxml.jackson.annotation.JsonFormat import org.gotson.komga.domain.model.AuthenticationActivity +import org.gotson.komga.language.toUTC import java.time.LocalDateTime data class AuthenticationActivityDto( @@ -24,6 +25,6 @@ fun AuthenticationActivity.toDto() = userAgent = userAgent, success = success, error = error, - dateTime = dateTime, + dateTime = dateTime.toUTC(), source = source, ) diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/PageHashKnownDto.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/PageHashKnownDto.kt index bcce66143..102ee07af 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/PageHashKnownDto.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/PageHashKnownDto.kt @@ -1,6 +1,7 @@ package org.gotson.komga.interfaces.api.rest.dto import org.gotson.komga.domain.model.PageHashKnown +import org.gotson.komga.language.toUTC import java.time.LocalDateTime data class PageHashKnownDto( @@ -20,6 +21,6 @@ fun PageHashKnown.toDto() = PageHashKnownDto( size = size, action = action, deleteCount = deleteCount, - created = createdDate, - lastModified = lastModifiedDate, + created = createdDate.toUTC(), + lastModified = lastModifiedDate.toUTC(), )