diff options
Diffstat (limited to 'src/client/elm/LoggedIn/Income/View.elm')
-rw-r--r-- | src/client/elm/LoggedIn/Income/View.elm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/client/elm/LoggedIn/Income/View.elm b/src/client/elm/LoggedIn/Income/View.elm index 3019fea..02e4467 100644 --- a/src/client/elm/LoggedIn/Income/View.elm +++ b/src/client/elm/LoggedIn/Income/View.elm @@ -34,10 +34,9 @@ import LoggedIn.Income.Model as IncomeModel import LoggedIn.Msg as LoggedInMsg import LoggedIn.Income.Msg as IncomeMsg -import LoggedIn.View.Date exposing (renderShortDate) +import View.Date as Date import LoggedIn.View.Format as Format -import LoggedIn.View.Date exposing (renderLongDate) import View.Color as Color view : LoggedData -> IncomeModel.Model -> Html Msg @@ -54,7 +53,7 @@ view loggedData incomeModel = cumulativeIncomesView : LoggedData -> Time -> Html Msg cumulativeIncomesView loggedData since = - let longDate = renderLongDate (Date.fromTime since) loggedData.translations + let longDate = Date.longView (Date.fromTime since) loggedData.translations in div [] [ h1 [] [ text <| getParamMessage [longDate] "CumulativeIncomesSince" loggedData.translations ] @@ -81,13 +80,13 @@ addIncomeView loggedData addIncome = let htmlMap = Html.map (Msg.UpdateLoggedIn << LoggedInMsg.IncomeMsg << IncomeMsg.AddIncomeMsg) in Html.form [ onSubmitPrevDefault Msg.NoOp ] - [ htmlMap <| Form.textInput loggedData.translations addIncome "income" "creation" - , htmlMap <| Form.textInput loggedData.translations addIncome "income" "amount" + [ htmlMap <| Form.textInput loggedData.translations addIncome "income" "amount" + , htmlMap <| Form.textInput loggedData.translations addIncome "income" "date" , button [ class "add" , case Form.getOutput addIncome of Just data -> - onClick (Msg.UpdateLoggedIn <| LoggedInMsg.AddIncome data.time data.amount) + onClick (Msg.UpdateLoggedIn <| LoggedInMsg.AddIncome data.amount data.date) Nothing -> onClick (Msg.UpdateLoggedIn <| LoggedInMsg.IncomeMsg <| IncomeMsg.AddIncomeMsg <| Form.Submit) ] @@ -110,7 +109,7 @@ incomeView : LoggedData -> (IncomeId, Income) -> Html Msg incomeView loggedData (incomeId, income) = li [] - [ text <| renderShortDate (Date.fromTime income.time) loggedData.translations + [ text <| Date.shortView (Date.fromTime income.time) loggedData.translations , text " − " , text <| Format.price loggedData.conf income.amount , let dialogConfig = |