Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

fix: removed csvFormat() and kept UTC format #3426

Merged
merged 6 commits into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.net.Uri
import arrow.core.Either
import com.ivy.base.model.TransactionType
import com.ivy.base.threading.DispatchersProvider
import com.ivy.base.time.convertToLocal
import com.ivy.data.file.FileSystem
import com.ivy.data.model.Account
import com.ivy.data.model.AccountId
Expand All @@ -24,6 +23,7 @@ import org.apache.commons.text.StringEscapeUtils
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
import java.time.Instant
import java.time.ZoneId
import java.time.format.DateTimeFormatter
import java.util.Locale
import javax.inject.Inject
Expand Down Expand Up @@ -187,8 +187,9 @@ class ExportCsvUseCase @Inject constructor(
id = id
)

private fun Instant.csvFormat(): String = convertToLocal()
.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
private fun Instant.csvFormat(): String {
return this.atZone(ZoneId.of("UTC")).toLocalDateTime().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
ILIYANGERMANOV marked this conversation as resolved.
Show resolved Hide resolved
}

private fun Double.csvFormat(): String = DecimalFormat(NUMBER_FORMAT).apply {
decimalFormatSymbols = DecimalFormatSymbols.getInstance(Locale.ENGLISH)
Expand Down