Date formats

Default date format across the product:

  • DD MMM YYYY (21 Feb 2021), following the European notation. DD MMM YY is also allowed, if space is an issue.
  • Use three-letter month name abbreviations: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec.

Date format with humanised text

When communicating events to the user (such as creation or update of content), round values up and use the following strings:

  • A few seconds ago (less than 60s)
  • 1 minute ago (60 -119s)
  • 2 - 59 minutes ago
  • 1 hour ago
  • 2 - 12 hours ago
  • Yesterday
  • After 48hours, show the date in the standard format, e.g., 21 Feb 2021.

 

Where required, use abbreviations to save space:

  • A few sec. ago, 30 sec. ago, 1-59 min. ago, 1-23 hr. ago
  • Remember to include the full stop at the end of abbrevation.

 

Technical guidelines

We are using a library called date-fns:

 

The tokens used for regular formatting are d MMM yyyy.

For relative formatting we are using a function called formatDistanceToNowStrict. You can read more about it here: