jrnl-org / jrnl

Collect your thoughts and notes without leaving the command line.
https://jrnl.sh
GNU General Public License v3.0
6.49k stars 523 forks source link

Add option to display relative dates/times #1721

Open dskrad opened 1 year ago

dskrad commented 1 year ago

Use Case/Motivation

I would like to be able to display entries with a relative or humanized date time.

Example Usage

jrnl --humanize -1

[1 day ago] I installed jrnl!!

Other Information

No response

micahellison commented 1 year ago

Hi @dskrad, thanks for filing this suggestion. I can see the use of this.

I think this would probably be better as a configuration key rather than in the command line. It could still be accessed via config-override. And I think "relative" would be a more specific term than "humanize" (which could mean a lot of other things).

The config key should be something like display_timeformat or timeformat_display. It should have the same behavior as timeformat except for two things: 1) it's only used for displaying the time (rather than storing) and 2) if it's set to a value like "relative" instead of a time format string, it shows the relative time format, such as "1 day ago" or "5 minutes ago".