Sort By Access Time and Change Time (#226)
- Add access time and change time as sort by types. This is powered by github.com/djherbis/times. - Fall back to modification time if access time and change time cannot be determined. - Add `sa` and `sc` as default bindings for sort by access time and sort by change time respectively. - Add access time and change time to info types allowing them to be displayed by the file list in the ui
This commit is contained in:
1 parent
d13cc79bc4
commit
9515bd73d0
7 files changed
+56
-13
No files matched your search
@@ -231,6 +231,10 @@ func fileInfo(f *file, d *dir) string {
|
||||
}
|
||||
case "time":
|
||||
info = fmt.Sprintf("%s %12s", info, f.ModTime().Format("Jan _2 15:04"))
|
||||
case "atime":
|
||||
info = fmt.Sprintf("%s %12s", info, f.accessTime.Format("Jan _2 15:04"))
|
||||
case "ctime":
|
||||
info = fmt.Sprintf("%s %12s", info, f.changeTime.Format("Jan _2 15:04"))
|
||||
default:
|
||||
log.Printf("unknown info type: %s", s)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user