aboutsummaryrefslogtreecommitdiff
path: root/client/src/View/Payment
diff options
context:
space:
mode:
authorJoris2018-06-24 22:02:00 +0200
committerJoris2018-06-24 22:02:00 +0200
commitdf83b634006c699cfa1e921bf74ce951a906a62f (patch)
tree65584291f8e93268326c6385df6c33d954b52199 /client/src/View/Payment
parent33b85b7f12798f5762d940ed5c30f775cdd7b751 (diff)
Use date input type
Diffstat (limited to 'client/src/View/Payment')
-rw-r--r--client/src/View/Payment/Add.hs8
-rw-r--r--client/src/View/Payment/Header.hs6
2 files changed, 7 insertions, 7 deletions
diff --git a/client/src/View/Payment/Add.hs b/client/src/View/Payment/Add.hs
index 2eaec0f..5ff09dd 100644
--- a/client/src/View/Payment/Add.hs
+++ b/client/src/View/Payment/Add.hs
@@ -8,6 +8,7 @@ import Control.Monad.IO.Class (liftIO)
import qualified Data.Map as M
import qualified Data.Maybe as Maybe
import qualified Data.Text as T
+import qualified Data.Time.Calendar as Calendar
import qualified Data.Time.Clock as Time
import Reflex.Dom (Event, MonadWidget)
import qualified Reflex.Dom as R
@@ -17,7 +18,6 @@ import Common.Model (Category (..), CreatePayment (..),
Frequency (..))
import qualified Common.Msg as Msg
import qualified Common.Util.Time as Time
-import qualified Common.View.Format as Format
import Component (ButtonIn (..), InputIn (..),
InputOut (..), SelectIn (..),
SelectOut (..))
@@ -49,8 +49,10 @@ view addIn = do
date <- _inputOut_value <$> (Component.input $
Component.defaultInputIn
- { _inputIn_label = Msg.get Msg.Payment_Cost
- , _inputIn_initialValue = Format.shortDay currentDay
+ { _inputIn_label = Msg.get Msg.Payment_Date
+ , _inputIn_initialValue = T.pack . Calendar.showGregorian $ currentDay
+ , _inputIn_inputType = "date"
+ , _inputIn_hasResetButton = False
})
frequency <- _selectOut_value <$> (Component.select $ SelectIn
diff --git a/client/src/View/Payment/Header.hs b/client/src/View/Payment/Header.hs
index d01dec6..fd46c25 100644
--- a/client/src/View/Payment/Header.hs
+++ b/client/src/View/Payment/Header.hs
@@ -104,10 +104,8 @@ payerAndAdd incomes payments users categories currency = do
searchLine :: forall t m. MonadWidget t m => m (Dynamic t Text, Dynamic t Frequency)
searchLine = do
R.divClass "searchLine" $ do
- searchName <- _inputOut_value <$> (Component.input $ InputIn
- { _inputIn_reset = R.never
- , _inputIn_label = Msg.get Msg.Search_Name
- , _inputIn_initialValue = ""
+ searchName <- _inputOut_value <$> (Component.input $ Component.defaultInputIn
+ { _inputIn_label = Msg.get Msg.Search_Name
})
let frequencies = M.fromList