Skip to content

Commit

Permalink
Merge pull request #4672 from wordpress-mobile/feature/reader-full-po…
Browse files Browse the repository at this point in the history
…st-refresh-master

Reader Full Post Refresh Design Review
  • Loading branch information
theck13 committed Oct 24, 2016
2 parents b105bf5 + 4419c47 commit 18bb900
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ public static String javaDateToTimeSpan(final Date date, Context context) {
// less than an hour (ex: 12m)
long minutesSince = secondsSince / 60;
if (minutesSince < 60) {
return Long.toString(minutesSince) + "m";
return Long.toString(minutesSince) + "m " + context.getString(R.string.timespan_ago);
}

// less than a day (ex: 17h)
long hoursSince = minutesSince / 60;
if (hoursSince < 24) {
return Long.toString(hoursSince) + "h";
return Long.toString(hoursSince) + "h " + context.getString(R.string.timespan_ago);
}

// less than a week (ex: 5d)
long daysSince = hoursSince / 24;
if (daysSince < 7) {
return Long.toString(daysSince) + "d";
return Long.toString(daysSince) + "d " + context.getString(R.string.timespan_ago);
}

// less than a year old, so return day/month without year (ex: Jan 30)
Expand Down
1 change: 1 addition & 0 deletions WordPressUtils/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<resources>
<string name="no_network_message">There is no network available</string>
<string name="timespan_now">Now</string>
<string name="timespan_ago">ago</string>
</resources>

0 comments on commit 18bb900

Please sign in to comment.