Exclude milliseconds from transaction dates

This commit is contained in:
William Brawner 2021-09-14 19:22:53 -06:00
parent ca28d32aa9
commit 5d26ee9af3

View file

@ -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,