Showing serverTransactionsRetentionDays and lastAccountUpdateTime to user
This commit is contained in:
parent
8324ac0101
commit
39c9006809
|
@ -13,7 +13,7 @@ import androidx.compose.ui.unit.sp
|
||||||
import net.codinux.banking.ui.config.Colors
|
import net.codinux.banking.ui.config.Colors
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LabelledValue(label: String, value: String?, valueTextColor: Color? = null) {
|
fun LabelledValue(label: String, value: String?, valueTextColor: Color? = null, labelMaxLines: Int = 1) {
|
||||||
|
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
Column(Modifier.fillMaxWidth()) {
|
Column(Modifier.fillMaxWidth()) {
|
||||||
|
@ -22,7 +22,7 @@ fun LabelledValue(label: String, value: String?, valueTextColor: Color? = null)
|
||||||
modifier = Modifier.padding(top = 12.dp, bottom = 2.dp),
|
modifier = Modifier.padding(top = 12.dp, bottom = 2.dp),
|
||||||
fontSize = 15.sp,
|
fontSize = 15.sp,
|
||||||
color = Colors.FormLabelTextColor,
|
color = Colors.FormLabelTextColor,
|
||||||
maxLines = 1,
|
maxLines = labelMaxLines,
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,10 @@ fun BankAccountSettingsScreen(account: BankAccountEntity, onClosed: () -> Unit)
|
||||||
LabelledValue("IBAN", account.iban ?: "")
|
LabelledValue("IBAN", account.iban ?: "")
|
||||||
|
|
||||||
LabelledValue("Typ", Internationalization.translate(account.type))
|
LabelledValue("Typ", Internationalization.translate(account.type))
|
||||||
|
|
||||||
|
LabelledValue("Anzahl Tage, für die Umsätze auf dem Server vorgehalten werden", account.serverTransactionsRetentionDays?.toString() ?: "<unbekannt>", labelMaxLines = 2)
|
||||||
|
|
||||||
|
LabelledValue("Umsätze zum letzten Mal abgerufen am", account.lastAccountUpdateTime?.let { DI.formatUtil.formatDateTime(it) } ?: "<Noch nicht abgerufen>" )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,15 @@ class FormatUtil {
|
||||||
fun formatDate(date: LocalDate): String = // TODO: find a better way
|
fun formatDate(date: LocalDate): String = // TODO: find a better way
|
||||||
"${minDigits(date.dayOfMonth, 2)}.${minDigits(date.monthNumber, 2)}.${date.year.toString().substring(2)}"
|
"${minDigits(date.dayOfMonth, 2)}.${minDigits(date.monthNumber, 2)}.${date.year.toString().substring(2)}"
|
||||||
|
|
||||||
|
fun formatDateTime(dateTime: Instant): String =
|
||||||
|
formatDateTime(dateTime.toLocalDateTime(TimeZone.currentSystemDefault()))
|
||||||
|
|
||||||
|
fun formatDateTime(dateTime: LocalDateTime): String =
|
||||||
|
"${formatDate(dateTime.date)} ${formatTime(dateTime.time)}"
|
||||||
|
|
||||||
|
fun formatTime(time: LocalTime): String = // TODO: find a better way
|
||||||
|
"${minDigits(time.hour, 2)}:${minDigits(time.minute, 2)}:${minDigits(time.second, 2)} Uhr"
|
||||||
|
|
||||||
fun formatGroupingDate(date: LocalDate, transactionsGrouping: TransactionsGrouping): String = when (transactionsGrouping) {
|
fun formatGroupingDate(date: LocalDate, transactionsGrouping: TransactionsGrouping): String = when (transactionsGrouping) {
|
||||||
TransactionsGrouping.Day -> formatDate(date)
|
TransactionsGrouping.Day -> formatDate(date)
|
||||||
TransactionsGrouping.Week -> formatWeek(date)
|
TransactionsGrouping.Week -> formatWeek(date)
|
||||||
|
|
Loading…
Reference in New Issue