Truncate recurring transaction times to seconds
Signed-off-by: William Brawner <me@wbrawner.com>
This commit is contained in:
parent
1fa28fb2e1
commit
13c4096fe8
1 changed files with 3 additions and 2 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue