2018-06-22 00:23:58 -04:00
|
|
|
module Main where
|
2018-06-21 22:24:42 -04:00
|
|
|
|
2018-06-22 00:23:58 -04:00
|
|
|
import Data.Time.Clock
|
|
|
|
import Data.Time.Calendar
|
2018-06-24 19:21:29 -04:00
|
|
|
import Data.Maybe
|
2018-06-21 22:24:42 -04:00
|
|
|
import Packs
|
2018-06-24 17:26:43 -04:00
|
|
|
import State
|
2018-06-24 19:21:29 -04:00
|
|
|
import Format
|
|
|
|
import Timestamp
|
2018-06-24 19:47:53 -04:00
|
|
|
import Preview
|
2018-06-22 00:23:58 -04:00
|
|
|
|
|
|
|
main :: IO ()
|
|
|
|
main = do
|
|
|
|
t <- getCurrentTime >>= return . toGregorian . utctDay
|
2018-06-24 19:47:53 -04:00
|
|
|
let ts = toTS t
|
|
|
|
let state = currentFormat ts
|
|
|
|
let out = (printLegal state) ++ [""] ++ (printPreview $ getPreview ts)
|
|
|
|
mapM_ putStrLn $ out
|
2018-06-24 19:21:29 -04:00
|
|
|
|
|
|
|
toTS :: (Integer, Int, Int) -> Timestamp
|
|
|
|
toTS (y,m,d) = Ts (fromIntegral d) (fromIntegral m) y
|