From 0ddd3ca05aac5eb441bd79afc085776dccadcbb6 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 19 Nov 2009 20:43:06 +0000 Subject: [PATCH] web: support full date syntax in add form --- Commands/Web.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Commands/Web.hs b/Commands/Web.hs index 869c6a128..f469df1ff 100644 --- a/Commands/Web.hs +++ b/Commands/Web.hs @@ -275,10 +275,11 @@ transactionfields n env = do handleAddform :: Ledger -> AppUnit handleAddform l = do env <- getenv - handle $ validate env + d <- io getCurrentDay + handle $ validate env d where - validate :: Hack.Env -> Failing LedgerTransaction - validate env = + validate :: Hack.Env -> Day -> Failing LedgerTransaction + validate env today = let inputs = Hack.Contrib.Request.inputs env date = fromMaybe "" $ lookup "date" inputs desc = fromMaybe "" $ lookup "desc" inputs @@ -299,7 +300,7 @@ handleAddform l = do validateAmt2 "" = ["missing amount 2"] validateAmt2 s = [] t = LedgerTransaction { - ltdate = parsedate date + ltdate = parsedate $ fixSmartDateStr today date ,lteffectivedate=Nothing ,ltstatus=False ,ltcode=""