From f101c20c9da59c8c644d3cb6fa0b1d08f63e40e4 Mon Sep 17 00:00:00 2001 From: Joris Date: Wed, 6 Apr 2016 14:44:18 +0200 Subject: Use translated month in stat page --- src/client/elm/Model/Payment.elm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/client/elm/Model') diff --git a/src/client/elm/Model/Payment.elm b/src/client/elm/Model/Payment.elm index 69315a9..013fc95 100644 --- a/src/client/elm/Model/Payment.elm +++ b/src/client/elm/Model/Payment.elm @@ -86,9 +86,10 @@ punctual = List.filter ((==) Punctual << .frequency) monthly : UserId -> Payments -> Payments monthly userId = List.filter (\p -> p.frequency == Monthly && p.userId == userId) -groupAndSortByMonth : Payments -> List ((Int, Int), Payments) +groupAndSortByMonth : Payments -> List ((Month, Int), Payments) groupAndSortByMonth payments = payments |> List.groupBy (\payment -> (Date.year payment.creation, Date.monthToNum << Date.month <| payment.creation)) |> List.sortBy fst + |> List.map (\((year, month), payments) -> ((Date.numToMonth month, year), payments)) |> List.reverse -- cgit v1.2.3