diff options
author | Martin Perner <martin@perner.cc> | 2011-10-27 20:51:19 +0200 |
---|---|---|
committer | Martin Perner <martin@perner.cc> | 2011-10-27 22:46:28 +0200 |
commit | f6bb8eb4c4350522367f4ab2dacbfeb0a99cd06d (patch) | |
tree | 304e4ca8230f78cb659dff9a4aeadd1f65242e85 /src/Plugins/DateL.hs | |
parent | 9718dabe6c6d5979e3f6837ef04a39d3ad8c786c (diff) | |
download | xmobar-f6bb8eb4c4350522367f4ab2dacbfeb0a99cd06d.tar.gz xmobar-f6bb8eb4c4350522367f4ab2dacbfeb0a99cd06d.tar.bz2 |
DateZone, Date*L Plugin merges; DateZone API-Change!
To support multiple locales, an lock was introduced.
Although through this, supporting DateL and DateZoneL would be
cumbersome.
To simplify the usage, DateZone was replaced with DateZoneL.
Additionally the position of the Alias parameter was changed.
Using "" as Zone parameter for DateZoneL simulates DateL.
Providing also "" for locale simulates Date.
Diffstat (limited to 'src/Plugins/DateL.hs')
-rw-r--r-- | src/Plugins/DateL.hs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/Plugins/DateL.hs b/src/Plugins/DateL.hs deleted file mode 100644 index d8859ed..0000000 --- a/src/Plugins/DateL.hs +++ /dev/null @@ -1,35 +0,0 @@ ------------------------------------------------------------------------------ --- | --- Module : Plugins.DateL --- Copyright : (c) Andrea Rossato --- License : BSD-style (see LICENSE) --- --- Maintainer : Martin Perner <martin@perner.cc> --- Stability : unstable --- Portability : unportable --- --- A date plugin with localization for Xmobar --- ------------------------------------------------------------------------------ - -module Plugins.DateL (DateL(..)) where - -import Plugins -import Localize - -import System.Time - -data DateL = DateL String String String Int - deriving (Read, Show) - -instance Exec DateL where - alias (DateL _ _ a _) = a - start (DateL f l _ r) cb = do - setupTimeLocale l - go - where go = date f >>= cb >> tenthSeconds r >> go - -date :: String -> IO String -date format = do - t <- toCalendarTime =<< getClockTime - return $ formatCalendarTime getTimeLocale format t |