Browse Source

Time fix for 12h users

pull/24/head
Apostolos Fanakis 7 years ago
parent
commit
8fe4ccfe44
  1. 8
      app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java
  2. 7
      app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java

8
app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java

@ -167,11 +167,11 @@ public class RecentFragment extends BaseFragment {
matcher = pattern.matcher(dateTime);
if (matcher.find()) {
dateTime = matcher.group(1);
dateTime=dateTime.substring(0,dateTime.lastIndexOf(":"));
if(!dateTime.contains(","))
dateTime=dateTime.substring(dateTime.lastIndexOf(" ")+1);
dateTime = dateTime.replaceAll(":[0-5][0-9] ", " ");
if (!dateTime.contains(",")) {
dateTime = dateTime.replaceAll(".+? ([0-9])", "$1");
}
else
} else
throw new ParseException("Parsing failed (dateTime)");
topicSummaries.add(new TopicSummary(link, title, lastUser, dateTime));

7
app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java

@ -174,9 +174,10 @@ public class UnreadFragment extends BaseFragment {
dateTime = dateTime.substring(0, dateTime.indexOf("<br>"));
dateTime = dateTime.replace("<b>", "");
dateTime = dateTime.replace("</b>", "");
dateTime=dateTime.substring(0,dateTime.lastIndexOf(":"));
if(!dateTime.contains(","))
dateTime=dateTime.substring(dateTime.lastIndexOf(" ")+1);
dateTime = dateTime.replaceAll(":[0-5][0-9] ", " ");
if (!dateTime.contains(",")) {
dateTime = dateTime.replaceAll(".+? ([0-9])", "$1");
}
topicSummaries.add(new TopicSummary(link, title, lastUser, dateTime));
}

Loading…
Cancel
Save