Wednesday, April 23, 2014

Smarter dates and times

Orbeon Forms prior to version 4.4 used to display full dates and times in the Summary page:

Full dates
Full dates

We didn’t like this because the resulting dates and times took a lot of precious space on screen.

One way to solve this is to indicate relative dates such as “3 hours ago”, “20 days ago”, or “1 year ago”. [1] But we don’t like this either because the resulting information is often rounded to the point of being meaningless.

Instead, we chose a very simple method inspired by applications such as Google Drive. [2] We use exactly 3 date and time formats:

  • if the instant is at most one day in the past, show hours and minutes only
  • if the year is the same as the current year, show the month and day only
  • otherwise, show year, month and day in a compact format

The result is as follows:

Short dates
Short dates

These shorter dates present enough meaningful information and always in a compact way. Of course this remains a tradeoff: for example if you want to save a screenshot for further reference, it would better to have full dates and times. But for most common uses, we think this is a pretty good approach. Let us know what you think!

This change is available in Orbeon Forms 4.4 and newer.

  1. As GitHub does, for example.  ↩

  2. Formerly Google Docs.  ↩

No comments:

Post a Comment