mirror of
https://github.com/simonmichael/hledger.git
synced 2025-01-04 00:07:29 +03:00
add: handle partial dates on the command line, instead of failing after all data entry
This commit is contained in:
parent
5785eae38e
commit
edcfd2abb1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user