diff options
author | Joris | 2017-04-02 17:51:12 +0200 |
---|---|---|
committer | Joris | 2017-04-02 21:07:08 +0200 |
commit | 5c110716cfda6e616a795edd12f2012b132dca9f (patch) | |
tree | 71c3d04780302edf0648bec1cd914757cdbb2883 /src/client/LoggedIn/Stat/Update.elm | |
parent | 64ff4707fdcd81c27c6be9903c3c82bc543ef016 (diff) |
Add a chart on payments by month by categories
Diffstat (limited to 'src/client/LoggedIn/Stat/Update.elm')
-rw-r--r-- | src/client/LoggedIn/Stat/Update.elm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/client/LoggedIn/Stat/Update.elm b/src/client/LoggedIn/Stat/Update.elm new file mode 100644 index 0000000..2415733 --- /dev/null +++ b/src/client/LoggedIn/Stat/Update.elm @@ -0,0 +1,24 @@ +module LoggedIn.Stat.Update exposing + ( update + ) + +import LoggedData exposing (LoggedData) +import LoggedIn.Stat.Model as Stat +import LoggedIn.Stat.Msg as Stat + +update : LoggedData -> Stat.Msg -> Stat.Model -> (Stat.Model, Cmd Stat.Msg) +update loggedData msg model = + case msg of + + Stat.NoOp -> + ( model + , Cmd.none + ) + + Stat.UpdateChart -> + let { currentTime, paymentCategories, payments } = loggedData + in ( { model + | paymentsByMonthByCategory = Stat.getPaymentsByMonthByCategory currentTime paymentCategories payments + } + , Cmd.none + ) |