exa icon indicating copy to clipboard operation
exa copied to clipboard

Idea: compressed "ago" dates

Open vi opened this issue 8 years ago • 14 comments

Dates like 16 Jun 2016 occupy reasonable screen space and requires mental parcing to determine how long ago it was.

In compressed dates mode it should be short and relative to current datetime:

  • Within 30 seconds of now => NOW (in red)
  • less than 60 minutes => XXmin
  • less than 24 hours => XXhrs
  • less than 32 days => XXday
  • less than 12 months => XXmon (maybe other colour starts here)
  • ... => Xyear
  • more than 9 years => OLD (bold?)
  • zero UNIX time => --- (pale gray)

vi avatar Aug 10 '17 23:08 vi

I love timeago, so I would appreciate this feature. Do you know of an existing fuzzy timestamp library for Rust? I can't seem to find anything on Google.

jdanford avatar Aug 11 '17 18:08 jdanford

Existing fuzzy timestamp will unlikely be short and fixed width.

We can develop such a library (only displaying, no parsing), it shouldn't be too hard.

vi avatar Aug 11 '17 20:08 vi

Good point! Are you interested in implementing this yourself, or do you want to leave that to someone else? I'd be happy to, assuming @ogham is okay with the general idea.

jdanford avatar Aug 11 '17 21:08 jdanford

Quickly hacked up a crate: timeago

vi avatar Aug 12 '17 11:08 vi

https://gist.github.com/vlnx/6cb393d73eda0294076a3af8ca2443ee

vlnx avatar Nov 27 '17 07:11 vlnx

@vlnx , Is my timeago crate not fit for this job? Should something from that patch be factored into it?

vi avatar Nov 27 '17 08:11 vi

I'm just new to rust and wanted to modify it more than pulling in a new package.

vlnx avatar Nov 27 '17 16:11 vlnx

Cool idea, but I think, if something is older than 9 year, it should display the date itself instead of OLD.

notramo avatar Dec 16 '17 13:12 notramo

+1 for this feature.

FWIW, I use ls++ (https://github.com/trapd00r/ls--/blob/master/ls%2B%2B), which displays colored relative time. Thinking about it, I think the colors are a nice touch, which helps me find what I want faster.

image

image

Versus:

image

Sarcasm avatar Sep 02 '18 14:09 Sarcasm

+1 image

smhmd avatar Nov 19 '19 16:11 smhmd

lsd uses chrono_humanize.

planet36 avatar Apr 07 '21 00:04 planet36

This is the one and only thing that keeps me to stick with lsd.

im-n1 avatar Aug 12 '21 14:08 im-n1

This is the one and only thing that makes me use lsd too !

sherifabdlnaby avatar Apr 27 '22 06:04 sherifabdlnaby

I created a first PR for this feature: https://github.com/ogham/exa/pull/1061

syphar avatar Apr 30 '22 13:04 syphar

Closing this, since exa is unmaintained (see https://github.com/ogham/exa/issues/1243), and this has been done in the active fork eza. Thanks!

ariasuni avatar Sep 28 '23 17:09 ariasuni