Skip to content
Snippets Groups Projects
Verified Commit 8ecddd97 authored by Tóth Miklós Tibor's avatar Tóth Miklós Tibor :shrug:
Browse files

fixed filelist dates

parent 343e5631
No related branches found
No related tags found
No related merge requests found
Pipeline #7534 passed
......@@ -33,7 +33,7 @@ var Filelist = helpers.Subcommand{
files := getData(args[0], list_map)
genLatex(files)
},
Help: "generate file list", // TODO
Help: "generate file list",
}
func readFile(filename string) []string {
......@@ -66,10 +66,13 @@ func getCreateTime(filepath string) string {
str := string(b)
lines := strings.Split(str, "\n")
str = lines[len(lines)-1]
str = lines[0]
if strings.Contains(str, "") {
strs := strings.Split(str, " ")
if len(strs) < 2 {
str = time.Now().Format("2006-01-02 15:04:05")
} else {
str = strs[0] + " " + strs[1]
}
return str
......@@ -98,7 +101,7 @@ func getData(dirname string, list map[string]string) []fileinfo {
file := fileinfo{
name: latexizeName(info.Name()),
size: strconv.FormatInt(info.Size(), 10) + " byte",
date: getCreateTime(path + info.Name()),
date: getCreateTime(path),
notes: data,
}
files = append(files, file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment