Truncate recurring transaction times to seconds

Signed-off-by: William Brawner <me@wbrawner.com>
This commit is contained in:
William Brawner 2023-03-04 09:16:49 -07:00
parent 1fa28fb2e1
commit 13c4096fe8

View file

@ -2,6 +2,7 @@ package com.wbrawner.twigs
import com.wbrawner.twigs.model.RecurringTransaction
import kotlinx.serialization.Serializable
import java.time.temporal.ChronoUnit
@Serializable
data class RecurringTransactionRequest(
@ -36,8 +37,8 @@ fun RecurringTransaction.asResponse(): RecurringTransactionResponse = RecurringT
title = title,
description = description,
frequency = frequency.toString(),
start = start.toString(),
finish = finish?.toString(),
start = start.truncatedTo(ChronoUnit.SECONDS).toString(),
finish = finish?.truncatedTo(ChronoUnit.SECONDS)?.toString(),
amount = amount,
expense = expense,
budgetId = budgetId,