From c61d93caae92d1ef74d47842dc3f9d312ac5ec90 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 11 Jan 2019 19:48:40 +0000 Subject: [PATCH] use date formatted that hopefully uses the system locale properly --- .../ktnx/mobileledger/ui/activity/MainActivity.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index 0991a694..a22d9891 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -51,8 +51,6 @@ import net.ktnx.mobileledger.utils.MLDB; import java.lang.ref.WeakReference; import java.text.DateFormat; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; import java.util.Date; public class MainActivity extends AppCompatActivity { @@ -163,13 +161,9 @@ public class MainActivity extends AppCompatActivity { tvLastUpdate.setText(R.string.transaction_last_update_never); } else { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - tvLastUpdate.setText(date.toInstant().atZone(ZoneId.systemDefault()) - .format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)); - } - else { - tvLastUpdate.setText(DateFormat.getDateTimeInstance().format(date)); - } + final String text = DateFormat.getDateTimeInstance().format(date); + tvLastUpdate.setText(text); + Log.d("despair", String.format("Date formatted: %s", text)); } }); }); -- 2.39.5