diff options
Diffstat (limited to 'org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java')
-rw-r--r-- | org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index 145a0341..2d0ddb22 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -965,7 +965,16 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, holder.dateView.setTextSize(TypedValue.COMPLEX_UNIT_SP, headlineSmallFontSize); Date d = new Date((long)article.updated * 1000); - DateFormat df = new SimpleDateFormat("MMM dd, HH:mm"); + Date now = new Date(); + + DateFormat df; + + if (now.getYear() == d.getYear() && now.getMonth() == d.getMonth() && now.getDay() == d.getDay()) { + df = new SimpleDateFormat("HH:mm"); + } else { + df = new SimpleDateFormat("MMM dd"); + } + df.setTimeZone(TimeZone.getDefault()); holder.dateView.setText(df.format(d)); } |