aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Model
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/elm/Model')
-rw-r--r--src/client/elm/Model/Income.elm4
-rw-r--r--src/client/elm/Model/Translations.elm6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/client/elm/Model/Income.elm b/src/client/elm/Model/Income.elm
index 06ba772..a5ca34b 100644
--- a/src/client/elm/Model/Income.elm
+++ b/src/client/elm/Model/Income.elm
@@ -81,8 +81,8 @@ getIncomeAt time incomes =
then Just { userId = x.userId, time = time, amount = x.amount }
else Nothing
x1 :: x2 :: xs ->
- if x1.time < time && x2.time > time
- then Just { userId = x2.userId, time = time, amount = x2.amount }
+ if x1.time < time && x2.time >= time
+ then Just { userId = x1.userId, time = time, amount = x1.amount }
else getIncomeAt time (x2 :: xs)
[] ->
Nothing
diff --git a/src/client/elm/Model/Translations.elm b/src/client/elm/Model/Translations.elm
index 9499dde..57409b0 100644
--- a/src/client/elm/Model/Translations.elm
+++ b/src/client/elm/Model/Translations.elm
@@ -49,11 +49,11 @@ partDecoderWithTag tag =
-----
-getMessage : String -> Translations -> String
+getMessage : Translations -> String -> String
getMessage = getParamMessage []
-getParamMessage : List String -> String -> Translations -> String
-getParamMessage values key translations =
+getParamMessage : List String -> Translations -> String -> String
+getParamMessage values translations key =
getTranslation key translations
|> Maybe.map (\parts -> String.concat (List.map (replacePart values) parts))
|> withDefault key