aboutsummaryrefslogtreecommitdiff
path: root/src/Model/Timer.elm
blob: 35850fcb94f444298c6132acb7512b9712780baa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module Model.Timer
  ( Timer
  , initialTimer
  , initTime
  ) where

import List
import Time (Time)

import Model.TimerState (..)

type alias Timer =
  { creationTime : Time
  , name : Maybe String
  , initialTime : Time
  , currentTime : Time
  , state : TimerState
  }

initialTimer : Time -> Timer
initialTimer creationTime =
  let initialTime = 5 * 60 * 1000
  in  { creationTime = creationTime
      , name = Nothing
      , initialTime = initialTime
      , currentTime = initTime initialTime
      , state = Idle
      }

initTime : Time -> Time
initTime t = t + 999