diff --git a/docs/configuration/yazi.md b/docs/configuration/yazi.md index ad22bf5b..9bc2bd24 100644 --- a/docs/configuration/yazi.md +++ b/docs/configuration/yazi.md @@ -82,17 +82,17 @@ linemode = "size_and_mtime" ```lua -- ~/.config/yazi/init.lua function Linemode:size_and_mtime() - local year = os.date("%Y") local time = math.floor(self._file.cha.modified or 0) - - if time > 0 and os.date("%Y", time) == year then + if time == 0 then + time = "" + elseif os.date("%Y", time) == os.date("%Y") then time = os.date("%b %d %H:%M", time) else - time = time and os.date("%b %d %Y", time) or "" + time = os.date("%b %d %Y", time) end local size = self._file:size() - return ui.Line(string.format(" %s %s ", size and ya.readable_size(size) or "-", time)) + return ui.Line(string.format("%s %s", size and ya.readable_size(size) or "-", time)) end ```