]> git.ktnx.net Git - mobile-ledger.git/commitdiff
use date formatted that hopefully uses the system locale properly
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 11 Jan 2019 19:48:40 +0000 (19:48 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 11 Jan 2019 19:48:40 +0000 (19:48 +0000)
app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java

index 0991a694a3b28d2ea0f5000d5ae4d9a3e4185ed4..a22d9891824a70e9b59bda2cc8b0f4bf81d0d979 100644 (file)
@@ -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));
                 }
             });
         });