diff options
author | Hendrik Jaeger <henk@frustcomp> | 2013-12-24 00:09:24 +0100 |
---|---|---|
committer | Hendrik Jaeger <henk@frustcomp> | 2013-12-24 00:09:24 +0100 |
commit | fb819c7f223632dd5baadebbfb6ad6732458390d (patch) | |
tree | cc79195f74bb2521469296d52a49e2830039d914 /diddohs.hs | |
parent | 7bc2168552de76fa7c985b65608199296b6ff55f (diff) |
On branch master
Changes to be committed:
new file: Diddo/Entry.hs
new file: HMSTime.hs
modified: diddohs.hs
CHANGED: imports cleanup
CHANGED: code for HMSTime and DiddoEntry exported to modules
Diffstat (limited to 'diddohs.hs')
-rw-r--r-- | diddohs.hs | 20 |
1 files changed, 2 insertions, 18 deletions
@@ -7,24 +7,8 @@ import Data.Monoid( mempty ) import Data.Time.Clock( secondsToDiffTime ) import Options.Applicative( execParser, info, strOption, long ) import System.Environment( getArgs ) -import Text.Printf( printf ) - -data HMSTime = HMSTime { hours :: Integer, minutes :: Integer, seconds :: Integer } -instance Show HMSTime where - show (HMSTime h m s) = printf "%d:%02d:%02d" h m s - -secondsToHMS :: Integer -> HMSTime -secondsToHMS seconds = HMSTime h m s where - (mLeft, s) = seconds `divMod` 60 - (h, m) = mLeft `divMod` 60 - -data DiddoEntry = DiddoEntry { start :: String - , finish :: String - , delta :: HMSTime - , entry :: String - } -instance Show DiddoEntry where - show (DiddoEntry start finish delta entry) = printf "%s;%s;%s;%s" start finish (show delta) entry +import HMSTime( HMSTime(..), secondsToHMS ) +import Diddo.Entry( DiddoEntry(..) ) data DiddoOpts = DiddoOpts { inDateFmt :: String |