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