fix: adjust Git log formatter to fix crash
Fixes: d37fdfdbaa
("fix(app): fully migrate to `java.time`")
This commit is contained in:
parent
6cb2f2ae77
commit
04a143126b
1 changed files with 7 additions and 1 deletions
|
@ -12,7 +12,10 @@ import app.passwordstore.databinding.GitLogRowLayoutBinding
|
|||
import app.passwordstore.util.git.GitCommit
|
||||
import app.passwordstore.util.git.GitLogModel
|
||||
import java.time.Instant
|
||||
import java.time.ZoneId
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.time.format.FormatStyle
|
||||
import java.util.Locale
|
||||
import logcat.LogPriority.ERROR
|
||||
import logcat.logcat
|
||||
|
||||
|
@ -21,7 +24,10 @@ private fun shortHash(hash: String): String {
|
|||
}
|
||||
|
||||
private fun stringFrom(date: Instant): String {
|
||||
return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(date)
|
||||
return DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM)
|
||||
.withLocale(Locale.getDefault())
|
||||
.withZone(ZoneId.systemDefault())
|
||||
.format(date)
|
||||
}
|
||||
|
||||
/** @see GitLogActivity */
|
||||
|
|
Loading…
Reference in a new issue