fix: dates de l'historique en heure locale
This commit is contained in:
1 file changed
+6
-2
@@ -34,6 +34,8 @@ import com.livrets.data.HistoryRepository
|
|||||||
import com.livrets.game.GameResult
|
import com.livrets.game.GameResult
|
||||||
import com.livrets.game.TableStats
|
import com.livrets.game.TableStats
|
||||||
import com.livrets.game.tableStats
|
import com.livrets.game.tableStats
|
||||||
|
import kotlinx.datetime.TimeZone
|
||||||
|
import kotlinx.datetime.toLocalDateTime
|
||||||
import kotlin.time.Instant
|
import kotlin.time.Instant
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -69,8 +71,10 @@ fun HistoryScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun formatDate(date: Instant): String =
|
private fun formatDate(date: Instant): String {
|
||||||
date.toString().take(16).replace('T', ' ')
|
val local = date.toLocalDateTime(TimeZone.currentSystemDefault())
|
||||||
|
return "${local.date} ${local.time.toString().take(5)}"
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun GamesTab(games: List<GameResult>) {
|
private fun GamesTab(games: List<GameResult>) {
|
||||||
|
|||||||
Reference in new issue
Block a user