Column - Age

Version 1.2 - 9 December 2016

Broke columns down into Age (M-Units), Age (M-Auto), Age (C-Units), and Age (C-Auto). In addition, added config options for column size and justification.

Version 1.1 - 9 December 2016

Based on tbone's ModifiedWithin column script, this script provides two columns:

Age (M) - age since last modified of the folder/file
Age (C) - age since created of the folder/file

The script allows the user to independently choose each column's config as follows:

Auto: age is presented as number with corresponding time measure

examples:

  • 2.3 yrs
  • 142 days
  • 10.1 hrs
  • 27 min

Units: age is presented as yy:ddd:hh:mm:ss

Examples:

  • 02:071:10:27:32
  • 00:172:05:22:18

Thanks to tbone for the inspiration and help, and to the DOpus team for the multicol fix!
Column.Generic_Age.js.txt (17.4 KB)

1 Like

Rethinking the approach to toggle the formatting of the columns via the script config.. it might not be the best thing to do.

If we look at what DO does natively, toggling column formats does not match. DO provides several columns in different flavors (formatting wise) like the size column with bytes/auto etc. Given that script columns can be used in find operations and filters, the result of these will always depend on the script config, which is not very obvious. Imagine if someone downloads column set X and looks up a filter definition Y. There is a high chance that things won't work as expected, since the columns output might be different because of the default/user configuration of the script/column.

Not sure what you/others think, but I think it makes more sense to provide multiple columns, each one offering a specific format. If there really is the need for a custom formatting, provide all the default columns and an "Age (Custom)" or something on top, so it's obvious that this columns output is subject to change, whereas all others will always deliver the same known format and values.

Don't get me wrong, nothing wrong with your columns and we surely learned something along the way.
Just saying that we can do even better! o)

Half the exercise for me was to learn something about scripting. I count that as a success. Along the way it identified a multicol issue, which the latest beta solves. That's a success, as well.

Going the multiple column route makes a lot of sense given the way columns are typically presented now in DOpus. That and the script already has the code ready. It won't take much to build the other columns.

... And I think we're there. Version 1.2 breaks it down into four column choices, rather than two with independent configs. Version 1.2 loaded into original post.

There is a slight difference in calculating age,it's not accurate,for some other files also i have seen same problem.The first pic is from xyplorer and second is opus'sxy age

op age

Hard to tell which is accurate when we can't see the file dates or current time. That would be better information to include than bringing up a different piece of software.

(Also important for understanding if DST changes between the start and end date could be in play. "1 day" may mean 23 or 25 hours sometimes, depending on at which level things are calculated. It's probably just different rounding methods though.)

Where is the problem? 14 days 23 hrs is 14.9583 days, rounded to one decimal is 15.0 days. It doesn't get better than this.

2 Likes