Re: change "timeformat_old" from 6 months to 1 year



On 9/18/16, Fourhundred Thecat <400thecat gmx ch> wrote:
Hello,

I am using different date formats for "timeformat_recent" and
"timeformat_old":

  [Misc]
  timeformat_recent=%b %e  %H:%M
  timeformat_old=%Y %b %e  %H:%M

which gives me nice, clean dates, where new files are immediately
distinguished from older ones:

       Sep  3  15:13
  2016 Mar 10  19:57

that works great, except that "timeformat_old" is used for files 6
months or older.

I would like to change it to 1 year or older, so that for newer files
(less than one year), I don't see the year.

How can I do it ?

One possibility is to modify MC's source code:

    https://source.midnight-commander.org/S/lib--timefmt.c.html#L133

Change the "6L" (six months) to "12L".

(Another possibility is to use mc^2 and describe the logic with Lua.
This gives you more freedom than a fixed "1 year ago". For example,
here's a snippet that shows your timeformat_recent only for files
modified in 2016:
https://gist.github.com/mooffie/de41af651f9383c3bd38f0f6259522a0 )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]