diff options
author | Jonathan Grochowski <jongrocho@gmail.com> | 2012-03-03 22:54:36 -0800 |
---|---|---|
committer | Jonathan Grochowski <jongrocho@gmail.com> | 2012-03-03 22:54:36 -0800 |
commit | 20eb4cfb330b2a7ed9849823d8c25c8cfb46347a (patch) | |
tree | 830db43eeee7805d2c0c83188595513aa8683413 /src/Plugins | |
parent | 928e97953dd0ee086d61623586d5523164e25c15 (diff) | |
download | xmobar-20eb4cfb330b2a7ed9849823d8c25c8cfb46347a.tar.gz xmobar-20eb4cfb330b2a7ed9849823d8c25c8cfb46347a.tar.bz2 |
Update the DateZone plugin to use newer time package
Just as the Date plugin used the old-time package which would honor all
the available flags, so too did the DateZone plugin.
Diffstat (limited to 'src/Plugins')
-rw-r--r-- | src/Plugins/DateZone.hs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/Plugins/DateZone.hs b/src/Plugins/DateZone.hs index 86114bb..79596c9 100644 --- a/src/Plugins/DateZone.hs +++ b/src/Plugins/DateZone.hs @@ -34,7 +34,6 @@ import Data.Time.LocalTime.TimeZone.Series import System.IO.Unsafe import System.Locale (TimeLocale) -import System.Time @@ -62,11 +61,9 @@ instance Exec DateZone where where go func = func >>= cb >> tenthSeconds r >> go func date :: String -> TimeLocale -> IO String -date format loc = do - t <- toCalendarTime =<< getClockTime - return $ formatCalendarTime loc format t +date format loc = getZonedTime >>= return . formatTime loc format dateZone :: String -> TimeLocale -> TimeZoneSeries -> IO String -dateZone format loc timeZone = do - zonedTime <- getZonedTime - return $ formatTime loc format $ utcToLocalTime' timeZone $ zonedTimeToUTC zonedTime +dateZone format loc timeZone = getZonedTime >>= return . formatTime loc format . utcToLocalTime' timeZone . zonedTimeToUTC +-- zonedTime <- getZonedTime +-- return $ formatTime loc format $ utcToLocalTime' timeZone $ zonedTimeToUTC zonedTime |