]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Localize the start and end dates for `ViewSslCertificate.java` and `SslCertificateErr...
authorSoren Stoutner <soren@stoutner.com>
Thu, 26 Jan 2017 23:38:29 +0000 (16:38 -0700)
committerSoren Stoutner <soren@stoutner.com>
Thu, 26 Jan 2017 23:38:29 +0000 (16:38 -0700)
app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateError.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewSslCertificate.java
app/src/main/java/com/stoutner/privacybrowser/helpers/OrbotProxyHelper.java

index 1e95616258c9cae22d326319eba331bd165db9cb..10afe62e98f133b79709961e846c9388954d8dba 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright 2016 Soren Stoutner <soren@stoutner.com>.
+ * Copyright 2016-2017 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
  *
@@ -37,6 +37,7 @@ import android.widget.TextView;
 
 import com.stoutner.privacybrowser.R;
 
+import java.text.DateFormat;
 import java.util.Date;
 
 public class SslCertificateError extends AppCompatDialogFragment {
@@ -76,8 +77,8 @@ public class SslCertificateError extends AppCompatDialogFragment {
         argumentsBundle.putString("IssuedByCName", issuedByCNameForBundle);
         argumentsBundle.putString("IssuedByOName", issuedByONameForBundle);
         argumentsBundle.putString("IssuedByUName", issuedByUNameForBundle);
-        argumentsBundle.putString("StartDate", startDateForBundle.toString());
-        argumentsBundle.putString("EndDate", endDateForBundle.toString());
+        argumentsBundle.putString("StartDate", DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.LONG).format(startDateForBundle));
+        argumentsBundle.putString("EndDate", DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.LONG).format(endDateForBundle));
 
         // Add `argumentsBundle` to this instance of `SslCertificateError`.
         SslCertificateError thisSslCertificateErrorDialog = new SslCertificateError();
index d977cbedaac471aa5251493138e7a46f952e8f3c..b675c45b755f78f52fd2ae1bf4cd1f6975310a85 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright 2016 Soren Stoutner <soren@stoutner.com>.
+ * Copyright 2016-2017 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
  *
@@ -36,6 +36,7 @@ import android.widget.TextView;
 import com.stoutner.privacybrowser.activities.MainWebView;
 import com.stoutner.privacybrowser.R;
 
+import java.text.DateFormat;
 import java.util.Date;
 
 // `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
@@ -122,8 +123,8 @@ public class ViewSslCertificate extends DialogFragment {
             SpannableStringBuilder issuedByCNameStringBuilder = new SpannableStringBuilder(cNameLabel + issuedByCNameString);
             SpannableStringBuilder issuedByONameStringBuilder = new SpannableStringBuilder(oNameLabel + issuedByONameString);
             SpannableStringBuilder issuedByUNameStringBuilder = new SpannableStringBuilder(uNameLabel + issuedByUNameString);
-            SpannableStringBuilder startDateStringBuilder = new SpannableStringBuilder(startDateLabel + startDate.toString());
-            SpannableStringBuilder endDateStringBuilder = new SpannableStringBuilder(endDateLabel + endDate.toString());
+            SpannableStringBuilder startDateStringBuilder = new SpannableStringBuilder(startDateLabel + DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.LONG).format(startDate));
+            SpannableStringBuilder endDateStringBuilder = new SpannableStringBuilder(endDateLabel + DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.LONG).format(endDate));
 
             // Create a blue `ForegroundColorSpan`.  We have to use the deprecated `getColor` until API >= 23.
             @SuppressWarnings("deprecation") ForegroundColorSpan blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));
index 6e751411ed0d8e4798b06a363998e9314424f458..87db7ea6c799ce24710181ba88286a98aa4378f0 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright 2016 Soren Stoutner <soren@stoutner.com>.
+ * Copyright 2016-2017 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
  *