aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Model/Payment.elm
diff options
context:
space:
mode:
authorJoris2016-06-12 23:54:17 +0200
committerJoris2016-06-12 23:54:17 +0200
commit6a0c5087f716ed6c876a666db6573491bfd3e094 (patch)
treebf439109143c7a1749c2661fc8b805b83a993027 /src/client/elm/Model/Payment.elm
parent38896af4281d2e191cbde15836a23e4c0274fff6 (diff)
downloadbudget-6a0c5087f716ed6c876a666db6573491bfd3e094.tar.gz
budget-6a0c5087f716ed6c876a666db6573491bfd3e094.tar.bz2
budget-6a0c5087f716ed6c876a666db6573491bfd3e094.zip
Design income form
Diffstat (limited to 'src/client/elm/Model/Payment.elm')
-rw-r--r--src/client/elm/Model/Payment.elm6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/elm/Model/Payment.elm b/src/client/elm/Model/Payment.elm
index d9a5d68..7a6c630 100644
--- a/src/client/elm/Model/Payment.elm
+++ b/src/client/elm/Model/Payment.elm
@@ -15,6 +15,7 @@ module Model.Payment exposing
)
import Date exposing (..)
+import Date.Extra.Core exposing (monthToInt, intToMonth)
import Json.Decode as Json exposing ((:=))
import String
@@ -22,7 +23,6 @@ import Model.User exposing (UserId, userIdDecoder)
import Model.Date exposing (dateDecoder)
import Utils.List as List
-import Utils.Date as Date
perPage : Int
perPage = 8
@@ -91,9 +91,9 @@ monthly userId = List.filter (\p -> p.frequency == Monthly && p.userId == userId
groupAndSortByMonth : Payments -> List ((Month, Int), Payments)
groupAndSortByMonth payments =
payments
- |> List.groupBy (\payment -> (Date.year payment.creation, Date.monthToNum << Date.month <| payment.creation))
+ |> List.groupBy (\payment -> (Date.year payment.creation, monthToInt << Date.month <| payment.creation))
|> List.sortBy fst
- |> List.map (\((year, month), payments) -> ((Date.numToMonth month, year), payments))
+ |> List.map (\((year, month), payments) -> ((intToMonth month, year), payments))
|> List.reverse
sortedFiltredPunctual : String -> Payments -> Payments