Thursday 15 September 2011

ios - What resolution to use with "time ago" labels -


I have an app that shows some state of the hardware. I know that when the hardware was entered it was said that the state (failed, active, useless, irrelevant, etc.) I am experimenting with showing the "first time" state over time but I have struggled to adjust the solution.

Easy under an hour, just show "minutes before" as you wander hours ago, but minutes are less and less important. I'm not sure that in 61 minutes a sudden "1 hour ago" jump is the right way. And when you have to switch "2 hours ago" Do you make that calculation round or small? The same dilemma exists at 24 hour point of view Do you show up to 25 hours ago, or just say 1 day ago. Or should there be an organ where I show "1 hour and 13 minutes before" and then leave minutes at some point.

I know that the "first" labels are not original. I'm curious how others have implemented it.

Moment.js is a very popular library used in the web such as what you are asking for Can only produce. Below they have a list of how they split their intervals into a more digestible format.

From their document:

  • 0 to 45 seconds seconds ago
  • 45 minutes ago
  • 90 seconds to 45 minutes 2 minutes before ... 45 minutes ago
  • 9 minutes to 22 hours 2 hours First ... 22 hours ago 36 hours for 25 days 2 days ago ... 25 days ago
  • < Li> 25 to 45 days a month ago
  • 45 to 345 days 2 months ago ... 11 months ago
  • < Li> 345 to 547 days (1.5 years) one year ago
  • 548 days + 2 years ago ... 20 years ago

No comments:

Post a Comment