From 7953ba6e78a98c444317faa6a04b50ab5453f6ab Mon Sep 17 00:00:00 2001 From: inorichi Date: Wed, 3 Feb 2016 13:28:55 +0100 Subject: [PATCH] Display date in local format. Fix #108 --- .../kanade/tachiyomi/ui/manga/chapter/ChaptersHolder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersHolder.java b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersHolder.java index a8c76fa82..e8cc3a927 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersHolder.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersHolder.java @@ -7,9 +7,9 @@ import android.widget.PopupMenu; import android.widget.RelativeLayout; import android.widget.TextView; +import java.text.DateFormat; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; -import java.text.SimpleDateFormat; import java.util.Date; import butterknife.Bind; @@ -38,7 +38,7 @@ public class ChaptersHolder extends FlexibleViewHolder { private final int unreadColor; private final DecimalFormat decimalFormat; - private SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); + private final DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT); public ChaptersHolder(View view, ChaptersAdapter adapter, OnListItemClickListener listener) { super(view, adapter, listener); @@ -71,6 +71,7 @@ public class ChaptersHolder extends FlexibleViewHolder { } title.setText(name); title.setTextColor(chapter.read ? readColor : unreadColor); + date.setTextColor(chapter.read ? readColor : unreadColor); if (!chapter.read && chapter.last_page_read > 0) { pages.setText(context.getString(R.string.chapter_progress, chapter.last_page_read + 1)); @@ -79,7 +80,7 @@ public class ChaptersHolder extends FlexibleViewHolder { } onStatusChange(chapter.status); - date.setText(sdf.format(new Date(chapter.date_upload))); + date.setText(df.format(new Date(chapter.date_upload))); } public void onStatusChange(int status) {