On 23/12/2019 01:48, Mike Miller wrote:
Hi,I'd like to use the --time-style option of ls to make dates more friendly, such as the Python library humanize does. This kind of library turns dates in the last week to something like "2 days ago..." etc. I use this value which is a close approximation: --time-style='+%Y-%m-%d %k:%M %a %k:%M' This results in something similar to long-iso when distant and a much simpler version when the file is recent: 2019-06-05 14:36 file1 Wed 13:25 file2 I'm happy enough with this format, but the problem is that the decision of what is recent appears to be hard-coded to be six months. I'd like to be able to configure that to be one week instead. Turns out file2 above was modified in July, haha. Any chance of getting an option to tune the "recent interval" parameter?
Often TIME_STYLE is configured in an env var, so we'd probably have to have a separate var to config that, which isn't ideal. I wonder could we auto set the "recent" limit based on the resolution of the format provided? I.E. If you specify %a, use a week as the recent threshold? cheers, Pádraig
