# HG changeset patch # User Kim Alvefur # Date 1682505729 -7200 # Node ID d9397d6a55134226f87c4106773e5e166a993fe4 # Parent 93d6ed7dc7796ffa2b3b876a3729717fb4215e35 mod_client_management: Show time for recent timestamps in shell command Semi-fuzzy time is nice diff -r 93d6ed7dc779 -r d9397d6a5513 mod_client_management/mod_client_management.lua --- a/mod_client_management/mod_client_management.lua Wed Apr 26 12:12:34 2023 +0200 +++ b/mod_client_management/mod_client_management.lua Wed Apr 26 12:42:09 2023 +0200 @@ -429,9 +429,10 @@ { title = "Last seen"; key = "last_seen"; - width = 10; + width = math.max(#os.date("%Y-%m-%d"), #os.date("%H:%M:%S")); + align = "right"; mapper = function(last_seen) - return os.date("%Y-%m-%d", last_seen); + return os.date(os.difftime(os.time(), last_seen) >= 86400 and "%Y-%m-%d" or "%H:%M:%S", last_seen); end; }; {