aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2023-07-26 17:18:49 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2023-07-26 17:18:58 +0530
commit04a143126baae34922754b59b077259cc8f7dee3 (patch)
treee3f77de410fc4c5e4e80aa7041b78f60b4327b7f /app/src/main/java
parent6cb2f2ae778d7e183f53c8b76a0f95e53c46e232 (diff)
fix: adjust Git log formatter to fix crash
Fixes: d37fdfdbaabe ("fix(app): fully migrate to `java.time`")
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/app/passwordstore/ui/git/log/GitLogAdapter.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/src/main/java/app/passwordstore/ui/git/log/GitLogAdapter.kt b/app/src/main/java/app/passwordstore/ui/git/log/GitLogAdapter.kt
index 9b7b77ed..a6e9180a 100644
--- a/app/src/main/java/app/passwordstore/ui/git/log/GitLogAdapter.kt
+++ b/app/src/main/java/app/passwordstore/ui/git/log/GitLogAdapter.kt
@@ -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 */