diff options
author | Joris | 2016-04-06 14:44:18 +0200 |
---|---|---|
committer | Joris | 2016-04-06 14:44:18 +0200 |
commit | f101c20c9da59c8c644d3cb6fa0b1d08f63e40e4 (patch) | |
tree | 3d946095e1ed5cf78b660f93da0d0fc99fb355d8 /src/client/elm/Model | |
parent | ac8a7c6210e2f430a3015e8004ff0726ef24d63b (diff) |
Use translated month in stat page
Diffstat (limited to 'src/client/elm/Model')
-rw-r--r-- | src/client/elm/Model/Payment.elm | 3 |
1 files changed, 2 insertions, 1 deletions
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 |