Skip to content
Snippets Groups Projects
Commit d3f3e6ee authored by Jens Nolte's avatar Jens Nolte
Browse files

Add short output variant to date block

The full date is very long compared to other blocks, which is
problematic when using qbar on devices with small or vertical screens
(e.g. on the Pinephone).
parent 98280bf1
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,9 @@ import Data.Time.LocalTime
dateBlock :: Block
dateBlock = runPollBlock' (everyNSeconds 60) $ forever $ do
zonedTime <- liftIO getZonedTime
let logo = "📅\xFE0E "
let date = T.pack (formatTime defaultTimeLocale "%a %F" zonedTime)
let time = T.pack (formatTime defaultTimeLocale "%R" zonedTime)
let text = normalText ("📅\xFE0E " <> date <> " ") <> activeText time
yieldBlockUpdate $ mkBlockOutput text
let text = normalText (logo <> date <> " ") <> activeText time
let short = normalText logo <> activeText time
yieldBlockUpdate $ (mkBlockOutput text) { _shortText = Just short }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment