Skip to content

Efficient algorithm for extracting the most relevant information from the date #510

@baruchel

Description

@baruchel

Most of the time, the arrival date of listed messages is the current day or the previous one; displaying the whole date is not very useful.

Another terminal client like Alpine follows a very interesting policy:

  • when the message is less than one day old, the time is displayed in a very clear format like 11:35
  • when the message is from yesterday, the date is "yesterday"
  • when the message is from the last 7 days, the name of the day is displayed "tuesday"

I don't remember the full behaviour in all cases, but I have found it very efficient for years. Maybe some similar algorithm could be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions