From 6a0c5087f716ed6c876a666db6573491bfd3e094 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 12 Jun 2016 23:54:17 +0200 Subject: Design income form --- src/client/elm/Model/Payment.elm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/client/elm/Model/Payment.elm') 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 -- cgit v1.2.3