Skip to content

Commit

Permalink
docs: fix linemode example
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Sep 16, 2024
1 parent 7efc161 commit 4a55cc5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/configuration/yazi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down

0 comments on commit 4a55cc5

Please sign in to comment.