diff --git a/hledger/Hledger/Cli/Add.hs b/hledger/Hledger/Cli/Add.hs index a8eeeec6c..26e5787a5 100644 --- a/hledger/Hledger/Cli/Add.hs +++ b/hledger/Hledger/Cli/Add.hs @@ -103,8 +103,10 @@ getTransactionOrRestart j opts defdate moredefs = do || s == "." || isRight (parseWithCtx nullctx dateandcodep $ lowercase s)) when (datecodestr == ".") $ ioError $ mkIOError eofErrorType "" Nothing Nothing + today <- getCurrentDay let (sdate,code) = fromparse $ parseWithCtx nullctx dateandcodep datecodestr - datestr = showDate $ fixSmartDate (parsedate defdate) sdate + defday = fixSmartDate today $ fromparse $ (parse smartdate "" . lowercase) defdate + datestr = showDate $ fixSmartDate defday sdate let (defdesc, moredefs') = headTailDef "" moredefs desc <- runInteractionDefault $ askFor "description" (Just defdesc) Nothing