diff options
author | Joris | 2015-09-06 16:50:44 +0200 |
---|---|---|
committer | Joris | 2015-09-06 16:50:44 +0200 |
commit | ae6fddcbf400ca5ed0f0c5671f9422f910f4a401 (patch) | |
tree | 697f8276c13674efd3d854dce5608bf48d47f508 /src/client/View/LoggedIn | |
parent | 3853811450d4fe801da996eb48825049c3541030 (diff) |
Sorting monthly payments by name
Diffstat (limited to 'src/client/View/LoggedIn')
-rw-r--r-- | src/client/View/LoggedIn/Monthly.elm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/View/LoggedIn/Monthly.elm b/src/client/View/LoggedIn/Monthly.elm index 14c3de7..715288b 100644 --- a/src/client/View/LoggedIn/Monthly.elm +++ b/src/client/View/LoggedIn/Monthly.elm @@ -2,6 +2,8 @@ module View.LoggedIn.Monthly ( monthlyPayments ) where +import String + import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (..) @@ -54,7 +56,10 @@ paymentsTable : Model -> LoggedInView -> Monthly -> Html paymentsTable model loggedInView monthly = div [ class "table" ] - ( List.map (paymentLine model loggedInView) monthly.payments ) + ( monthly.payments + |> List.sortBy (String.toLower << .name) + |> List.map (paymentLine model loggedInView) + ) paymentLine : Model -> LoggedInView -> Payment -> Html paymentLine model loggedInView payment = |