diff options
author | Joris Guyonvarch | 2015-03-16 21:10:07 +0100 |
---|---|---|
committer | Joris Guyonvarch | 2015-03-16 21:10:07 +0100 |
commit | 36cb1d0392f4d32a4eed50ef2cc098dc90bb44e1 (patch) | |
tree | 7040924025231ddedf42555129bb310043185e4d /src/Model | |
parent | 1cfd5e02bbd92f54a6b888d475f9f3002f3763bb (diff) |
Initial time is 999 ms more than it has to be in order to see for 999 ms the initial time
Diffstat (limited to 'src/Model')
-rw-r--r-- | src/Model/Timer.elm | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/Model/Timer.elm b/src/Model/Timer.elm index 7d345b2..bfb734d 100644 --- a/src/Model/Timer.elm +++ b/src/Model/Timer.elm @@ -2,6 +2,7 @@ module Model.Timer ( Timer , initialTimer , substractTimerTime + , initTime ) where import List @@ -17,12 +18,13 @@ type alias Timer = initialTimer : Time -> String -> Timer initialTimer creationTime name = - { creationTime = creationTime - , name = name - , initialTime = 5 * 60 * 1000 - , currentTime = 5 * 60 * 1000 - , isRunning = True - } + let initialTime = 5 * 60 * 1000 + in { creationTime = creationTime + , name = name + , initialTime = initialTime + , currentTime = initTime initialTime + , isRunning = True + } substractTimerTime : Time -> Timer -> Timer substractTimerTime time timer = @@ -40,3 +42,6 @@ substractTimerTime time timer = } else timer + +initTime : Time -> Time +initTime t = t + 999 |