I was reading this question about formatting relative dates and times, but there are still some issue that I felt have not been addressed yet.
I would like to:
Keep relative times to just 1 unit, for example
1 hour ago
as opposed to1 hour and 24 minutes ago
.When the time/date is hovered, we display the localized date, for example,
Tuesday, 24 July 2012 at 10:00 PM
.
Given the above:
Should I round up or round down times? For example how should I turn
1 hour and 24 minutes ago
into justhours
?Should I display relative days as
Yesterday
,2 Days ago
,3 Days ago
, orYesterday
,Tuesday
,Monday
?At what point should I stop with the
2 Days ago
,Tuesday
,Monday
and revert to displaying localized dates?Should I bother having relative time/dates for
weeks
andmonths
?When should I drop the time component and just display the date/day?
Answer
Rounding - you should apply the same rules you would to a floating point number so "1 hour 24 minutes" is less than 1.5 hours so it should be rounded down to "1 hour". When you pass 30 minutes then round up.
I'd go with "Yesterday", "2 days ago" etc.
A quick check on Stack Exchange shows that they use "Yesterday", "2 days ago", localised date, while (as you point out) Facebook goes for the days of the week. I think that the answer depends on how accurate you need the date to be. Do your users need to know the exact date (easily worked out from "today" and "yesterday", but slightly harder to work out from "Monday" or "Friday") or is "some time this week" or "recently" good enough?
If you're already displaying older dates as the actual date rather than "some time ago" when the date is a 2 or 3 days old, then having relative dates for weeks and months seems to be irrelevant.
While the time component for a date that's a year old appears to be irrelevant, it's probably not worth the extra coding effort to hide it for older dates. The benefit (if any) of hiding the time probably isn't worth the cost of writing and maintaining the necessary code.
However, with all of these it depends on how accurate you need your dates and times to be. Is it important that the displayed value is as accurate as possible or is the exact date/time on a tooltip OK?
No comments:
Post a Comment