summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJonathan Grochowski <jongrocho@gmail.com>2012-03-03 19:40:37 -0800
committerJonathan Grochowski <jongrocho@gmail.com>2012-03-03 19:40:37 -0800
commit928e97953dd0ee086d61623586d5523164e25c15 (patch)
treef1c04cf2c5b7b7565f7a6fd43df9eb7dfc2bce5b
parent43256a360a25a611a748c637da16aa49cceb181a (diff)
downloadxmobar-928e97953dd0ee086d61623586d5523164e25c15.tar.gz
xmobar-928e97953dd0ee086d61623586d5523164e25c15.tar.bz2
Update Date plugin to use newer time package
The Date plugin used the old-time package to format times which does not honor all escape sequences and optional flags (e.g. the - (hyphen) that should not pad the field).
-rw-r--r--src/Plugins/Date.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Plugins/Date.hs b/src/Plugins/Date.hs
index bfcb132..3caad30 100644
--- a/src/Plugins/Date.hs
+++ b/src/Plugins/Date.hs
@@ -21,7 +21,7 @@ module Plugins.Date (Date(..)) where
import Plugins
import System.Locale
-import System.Time
+import Data.Time
data Date = Date String String Int
deriving (Read, Show)
@@ -32,6 +32,4 @@ instance Exec Date where
rate (Date _ _ r) = r
date :: String -> IO String
-date format = do
- t <- toCalendarTime =<< getClockTime
- return $ formatCalendarTime defaultTimeLocale format t
+date format = getZonedTime >>= return . formatTime defaultTimeLocale format