-
Notifications
You must be signed in to change notification settings - Fork 6
/
Main.elm
52 lines (45 loc) · 1.05 KB
/
Main.elm
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
module Main exposing (..)
import Material
import Model exposing (..)
import Update exposing (Msg, update)
import View exposing (view)
import Html.App as Html
import Date exposing (..)
main : Program Never
main =
Html.program
{ init = init
, update = update
, view = view
, subscriptions = (always Sub.none)
}
init : ( Model, Cmd Msg )
init =
( initialModel
, Cmd.batch
[ Update.currentTime
, Update.getUser
, Update.getEntries
, Update.getHolidays
, Update.getSpecialTasks
]
)
initialModel : Model
initialModel =
{ httpError = Ok ()
, loading = True
, today = Date.fromTime 0
, currentDate = Date.fromTime 0
, entries = []
, totalHours = Nothing
, hourBalanceOfCurrentMonth = Nothing
, user = { firstName = "", lastName = "", previousBalance = 0 }
, holidays = []
, specialTasks =
{ ignore = []
, subtract = []
}
, previousBalanceString = ""
, previousBalance = 0
, mdl = Material.model
}