From 74888def281fdb4a62824ab74fbddd7b8569bc25 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 9 Sep 2019 21:31:36 +0800 Subject: Fixed SimpleDateFormat problem which causes the app to crash on start. --- .../main/java/ml/docilealligator/infinityforreddit/ParseComment.java | 2 +- app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseComment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseComment.java index 4bcaa29a..7f48d8ea 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseComment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseComment.java @@ -235,7 +235,7 @@ class ParseComment { Calendar submitTimeCalendar = Calendar.getInstance(); submitTimeCalendar.setTimeInMillis(submitTime); - String formattedSubmitTime = new SimpleDateFormat("MMM d, YYYY, HH:mm", + String formattedSubmitTime = new SimpleDateFormat("MMM d, yyyy, HH:mm", locale).format(submitTimeCalendar.getTime()); if(singleCommentData.has(JSONUtils.DEPTH_KEY)) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java index efe58ff0..bbfe8d56 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java @@ -184,7 +184,7 @@ class ParsePost { Calendar postTimeCalendar = Calendar.getInstance(); postTimeCalendar.setTimeInMillis(postTime); - String formattedPostTime = new SimpleDateFormat("MMM d, YYYY, HH:mm", + String formattedPostTime = new SimpleDateFormat("MMM d, yyyy, HH:mm", locale).format(postTimeCalendar.getTime()); String permalink = Html.fromHtml(data.getString(JSONUtils.PERMALINK_KEY)).toString(); -- cgit v1.2.3