mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-30 13:57:47 +00:00
fix: adjust Git log formatter to fix crash
Fixes: d37fdfdbaa
("fix(app): fully migrate to `java.time`")
This commit is contained in:
@@ -12,7 +12,10 @@ import app.passwordstore.databinding.GitLogRowLayoutBinding
|
|||||||
import app.passwordstore.util.git.GitCommit
|
import app.passwordstore.util.git.GitCommit
|
||||||
import app.passwordstore.util.git.GitLogModel
|
import app.passwordstore.util.git.GitLogModel
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
|
import java.time.ZoneId
|
||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
|
import java.time.format.FormatStyle
|
||||||
|
import java.util.Locale
|
||||||
import logcat.LogPriority.ERROR
|
import logcat.LogPriority.ERROR
|
||||||
import logcat.logcat
|
import logcat.logcat
|
||||||
|
|
||||||
@@ -21,7 +24,10 @@ private fun shortHash(hash: String): String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun stringFrom(date: Instant): 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 */
|
/** @see GitLogActivity */
|
||||||
|
Reference in New Issue
Block a user