From 5d26ee9af3eb8919f08b3c274c0619b67ebf6710 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Tue, 14 Sep 2021 19:22:53 -0600 Subject: [PATCH] Exclude milliseconds from transaction dates --- api/src/main/kotlin/com/wbrawner/twigs/TransactionApi.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/main/kotlin/com/wbrawner/twigs/TransactionApi.kt b/api/src/main/kotlin/com/wbrawner/twigs/TransactionApi.kt index dc4e1de..4062858 100644 --- a/api/src/main/kotlin/com/wbrawner/twigs/TransactionApi.kt +++ b/api/src/main/kotlin/com/wbrawner/twigs/TransactionApi.kt @@ -2,6 +2,7 @@ package com.wbrawner.twigs import com.wbrawner.twigs.model.Transaction import kotlinx.serialization.Serializable +import java.time.temporal.ChronoUnit @Serializable data class TransactionRequest( @@ -34,7 +35,7 @@ fun Transaction.asResponse(): TransactionResponse = TransactionResponse( id = id, title = title, description = description, - date = date.toString(), + date = date.truncatedTo(ChronoUnit.SECONDS).toString(), amount = amount, expense = expense, budgetId = budgetId,