how to add last modified(created) time to the status bar? #1113
-
As the title said. final code add to function Status:modified()
local time = cx.active.current.hovered.cha.modified
return ui.Span(time and os.date("%y-%m-%d %H:%M ", time // 1) or " "):fg("blue")
end
function Status:render(area)
self.area = area
local left = ui.Line({ self:mode(), self:size(), self:name() })
local right = ui.Line({ self:modified(), self:permissions(), self:percentage(), self:position() })
return {
ui.Paragraph(area, { left }),
ui.Paragraph(area, { right }):align(ui.Paragraph.RIGHT),
table.unpack(Progress:render(area, right:width())),
}
end Solved with the help of solit
|
Beta Was this translation helpful? Give feedback.
Answered by
SolitudeSF
Jun 3, 2024
Replies: 1 comment
-
function Status:modified()
local time = cx.active.current.hovered.cha.modified
return ui.Span(time and os.date("%y-%m-%d %H:%M ", time // 1) or " "):fg("blue")
end add this to |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
woshichuanqilz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add this to
init.lua
then override defaultStatus:render
including this (example in https://yazi-rs.github.io/docs/tips#user-group-in-status)