diff options
author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-10-03 16:27:00 +0200 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-10-03 16:27:00 +0200 |
commit | 825356d7ee6887f38f9e9b35a55bbe721c682b40 (patch) | |
tree | 998d7013cf6410a0ca559dafaeea699e51b10aed /Plugins | |
parent | dfa424ab5f3e1947e009e6dc73fd8d3a5f311e60 (diff) | |
download | xmobar-825356d7ee6887f38f9e9b35a55bbe721c682b40.tar.gz xmobar-825356d7ee6887f38f9e9b35a55bbe721c682b40.tar.bz2 |
Date: now implemented using rate and run
darcs-hash:20071003142700-d6583-92b890f3badd136dacbfccdcb8b68550f3fff3c8.gz
Diffstat (limited to 'Plugins')
-rw-r--r-- | Plugins/Date.hs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Plugins/Date.hs b/Plugins/Date.hs index 115cb96..02b1cb3 100644 --- a/Plugins/Date.hs +++ b/Plugins/Date.hs @@ -26,13 +26,11 @@ data Date = Date String String Int deriving (Read, Show) instance Exec Date where - start (Date f _ r) cb = date f r cb - alias (Date _ a _) = a + alias (Date _ a _) = a + run (Date f _ _) = date f + rate (Date _ _ r) = r -date :: String -> Int -> (String -> IO ()) -> IO () -date format r cb = do go - where go = do - t <- toCalendarTime =<< getClockTime - cb $ formatCalendarTime defaultTimeLocale format t - tenthSeconds r >> go -
\ No newline at end of file +date :: String -> IO String +date format = do + t <- toCalendarTime =<< getClockTime + return $ formatCalendarTime defaultTimeLocale format t |