24 lines
601 B
Haskell
24 lines
601 B
Haskell
|
|
module Main where
|
||
|
|
|
||
|
|
import MiniTimeWindows.Window
|
||
|
|
( formatInstant
|
||
|
|
, parseInstant
|
||
|
|
, renderStatus
|
||
|
|
, sampleWindows
|
||
|
|
, statusAt
|
||
|
|
)
|
||
|
|
import System.Environment (getArgs)
|
||
|
|
import System.Exit (die)
|
||
|
|
|
||
|
|
main :: IO ()
|
||
|
|
main = do
|
||
|
|
args <- getArgs
|
||
|
|
rawInstant <-
|
||
|
|
case args of
|
||
|
|
[] -> pure "2026-05-05T10:30:00Z"
|
||
|
|
[singleInstant] -> pure singleInstant
|
||
|
|
_ -> die "expected either no arguments or: <utc-timestamp>"
|
||
|
|
|
||
|
|
currentInstant <- either die pure (parseInstant rawInstant)
|
||
|
|
putStrLn ("at " ++ formatInstant currentInstant ++ ": " ++ renderStatus (statusAt currentInstant sampleWindows))
|