From 50fb8fa48d1c4881da20b4ecf6d68a772301e713 Mon Sep 17 00:00:00 2001 From: Joris Date: Tue, 30 Oct 2018 18:04:58 +0100 Subject: Update table when adding or removing a payment --- common/common.cabal | 2 +- common/src/Common/Util/Time.hs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'common') 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 -- cgit v1.2.3