aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJoris2018-10-30 18:04:58 +0100
committerJoris2018-10-30 18:04:58 +0100
commit50fb8fa48d1c4881da20b4ecf6d68a772301e713 (patch)
tree99c30c644d40664a9a7bb4a27e838d7cccda7a5f /common
parent40b4994797a797b1fa86cafda789a5c488730c6d (diff)
Update table when adding or removing a payment
Diffstat (limited to 'common')
-rw-r--r--common/common.cabal2
-rw-r--r--common/src/Common/Util/Time.hs6
2 files changed, 4 insertions, 4 deletions
diff --git a/common/common.cabal b/common/common.cabal
index 151326a..78f2927 100644
--- a/common/common.cabal
+++ b/common/common.cabal
@@ -29,6 +29,7 @@ Library
Common.Model
Common.Model.CreatePayment
Common.Model.Payment
+ Common.Model.User
Common.Msg
Common.Util.Text
Common.Util.Time
@@ -52,4 +53,3 @@ Library
Common.Model.Payer
Common.Model.PaymentCategory
Common.Model.SignIn
- Common.Model.User
diff --git a/common/src/Common/Util/Time.hs b/common/src/Common/Util/Time.hs
index 9ab7ab5..6240720 100644
--- a/common/src/Common/Util/Time.hs
+++ b/common/src/Common/Util/Time.hs
@@ -16,9 +16,9 @@ timeToDay time = localDay . (flip utcToLocalTime time) <$> getTimeZone time
parseDay :: Text -> Maybe Day
parseDay str = do
- (d, m, y) <-
- case T.splitOn str "/" of
- [d, m, y] -> Just (d, m, y)
+ (y, m, d) <-
+ case T.splitOn "-" str of
+ [y, m, d] -> Just (y, m, d)
_ -> Nothing
d' <- T.readMaybe . T.unpack $ d
m' <- T.readMaybe . T.unpack $ m