Fix documentation, make ISO date format standard in some places
This commit is contained in:
parent
0f5f573db7
commit
50acfc9119
@ -775,7 +775,7 @@ datesepchar :: TextParser m Char
|
||||
datesepchar = satisfy isDateSepChar
|
||||
|
||||
isDateSepChar :: Char -> Bool
|
||||
isDateSepChar c = c == '/' || c == '-' || c == '.'
|
||||
isDateSepChar c = c == '-' || c == '/' || c == '.'
|
||||
|
||||
validYear, validMonth, validDay :: String -> Bool
|
||||
validYear s = length s >= 4 && isJust (readMay s :: Maybe Year)
|
||||
|
||||
@ -127,12 +127,12 @@ payeeAndNoteFromDescription t
|
||||
(p, n) = T.span (/= '|') t
|
||||
|
||||
{-|
|
||||
Render a journal transaction as text in the style of Ledger's print command.
|
||||
Render a journal transaction as text similar to the style of Ledger's print command.
|
||||
|
||||
Ledger 2.x's standard format looks like this:
|
||||
Adapted from Ledger 2.x and 3.x standard format:
|
||||
|
||||
@
|
||||
yyyy/mm/dd[ *][ CODE] description......... [ ; comment...............]
|
||||
yyyy-mm-dd[ *][ CODE] description......... [ ; comment...............]
|
||||
account name 1..................... ...$amount1[ ; comment...............]
|
||||
account name 2..................... ..$-amount1[ ; comment...............]
|
||||
|
||||
|
||||
@ -403,8 +403,8 @@ descriptionp = takeWhileP Nothing (not . semicolonOrNewline)
|
||||
|
||||
--- ** dates
|
||||
|
||||
-- | Parse a date in YYYY/MM/DD format.
|
||||
-- Hyphen (-) and period (.) are also allowed as separators.
|
||||
-- | Parse a date in YYYY-MM-DD format.
|
||||
-- Slash (/) and period (.) are also allowed as separators.
|
||||
-- The year may be omitted if a default year has been set.
|
||||
-- Leading zeroes may be omitted.
|
||||
datep :: JournalParser m Day
|
||||
@ -456,8 +456,8 @@ datep' mYear = do
|
||||
|
||||
{-# INLINABLE datep' #-}
|
||||
|
||||
-- | Parse a date and time in YYYY/MM/DD HH:MM[:SS][+-ZZZZ] format.
|
||||
-- Hyphen (-) and period (.) are also allowed as date separators.
|
||||
-- | Parse a date and time in YYYY-MM-DD HH:MM[:SS][+-ZZZZ] format.
|
||||
-- Slash (/) and period (.) are also allowed as date separators.
|
||||
-- The year may be omitted if a default year has been set.
|
||||
-- Seconds are optional.
|
||||
-- The timezone is optional and ignored (the time is always interpreted as a local time).
|
||||
|
||||
Loading…
Reference in New Issue
Block a user