aboutsummaryrefslogtreecommitdiff
path: root/src/client/Model/Income.elm
diff options
context:
space:
mode:
authorJoris2015-10-04 21:06:23 +0200
committerJoris2015-10-04 21:06:23 +0200
commitd920dd95be096dcaa2fa2314d729fdff52631fd6 (patch)
tree1e51b73c5bf77d7f9fb885141920a853b7a830f7 /src/client/Model/Income.elm
parent7d03ea5a064b616b4aa5b6cf6db24019e59131ea (diff)
downloadbudget-d920dd95be096dcaa2fa2314d729fdff52631fd6.tar.gz
budget-d920dd95be096dcaa2fa2314d729fdff52631fd6.tar.bz2
budget-d920dd95be096dcaa2fa2314d729fdff52631fd6.zip
Factor incomeDefinedForAll utilization
Diffstat (limited to 'src/client/Model/Income.elm')
-rw-r--r--src/client/Model/Income.elm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/Model/Income.elm b/src/client/Model/Income.elm
index ce30772..97a5652 100644
--- a/src/client/Model/Income.elm
+++ b/src/client/Model/Income.elm
@@ -25,9 +25,9 @@ incomeDecoder =
("creation" := timeDecoder)
("amount" := Json.int)
-incomeDefinedForAll : List (UserId, List Income) -> Maybe Time
+incomeDefinedForAll : List (List Income) -> Maybe Time
incomeDefinedForAll usersIncomes =
- let firstIncomes = map (head << sortBy .creation << snd) usersIncomes
+ let firstIncomes = map (head << sortBy .creation) usersIncomes
in if all isJust firstIncomes
then head << reverse << List.sort << map .creation << catMaybes <| firstIncomes
else Nothing