summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Xmobar/Plugins/Date.hs14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/Xmobar/Plugins/Date.hs b/src/Xmobar/Plugins/Date.hs
index 83ca1c9..1cb0596 100644
--- a/src/Xmobar/Plugins/Date.hs
+++ b/src/Xmobar/Plugins/Date.hs
@@ -31,16 +31,8 @@ data Date = Date String String Int
instance Exec Date where
alias (Date _ a _) = a
+ run (Date f _ _) = date f
rate (Date _ _ r) = r
- start (Date f _ r) cb = do
- t <- getCurrentTime
- zone <- getTimeZone t
- go zone
- where
- go zone = doEveryTenthSeconds r $ date zone f >>= cb
-date :: TimeZone -> String -> IO String
-date timezone format = do
- time <- getCurrentTime
- let zonedTime = utcToZonedTime timezone time
- pure $ formatTime defaultTimeLocale format zonedTime
+date :: String -> IO String
+date format = fmap (formatTime defaultTimeLocale format) getZonedTime