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 | datesepchar = satisfy isDateSepChar | ||||||
| 
 | 
 | ||||||
| isDateSepChar :: Char -> Bool | isDateSepChar :: Char -> Bool | ||||||
| isDateSepChar c = c == '/' || c == '-' || c == '.' | isDateSepChar c = c == '-' || c == '/' || c == '.' | ||||||
| 
 | 
 | ||||||
| validYear, validMonth, validDay :: String -> Bool | validYear, validMonth, validDay :: String -> Bool | ||||||
| validYear s = length s >= 4 && isJust (readMay s :: Maybe Year) | validYear s = length s >= 4 && isJust (readMay s :: Maybe Year) | ||||||
|  | |||||||
| @ -127,12 +127,12 @@ payeeAndNoteFromDescription t | |||||||
|     (p, n) = T.span (/= '|') 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 1.....................  ...$amount1[  ; comment...............] | ||||||
|     account name 2.....................  ..$-amount1[  ; comment...............] |     account name 2.....................  ..$-amount1[  ; comment...............] | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -403,8 +403,8 @@ descriptionp = takeWhileP Nothing (not . semicolonOrNewline) | |||||||
| 
 | 
 | ||||||
| --- ** dates | --- ** dates | ||||||
| 
 | 
 | ||||||
| -- | Parse a date in YYYY/MM/DD format. | -- | Parse a date in YYYY-MM-DD format. | ||||||
| -- Hyphen (-) and period (.) are also allowed as separators. | -- Slash (/) and period (.) are also allowed as separators. | ||||||
| -- The year may be omitted if a default year has been set. | -- The year may be omitted if a default year has been set. | ||||||
| -- Leading zeroes may be omitted. | -- Leading zeroes may be omitted. | ||||||
| datep :: JournalParser m Day | datep :: JournalParser m Day | ||||||
| @ -456,8 +456,8 @@ datep' mYear = do | |||||||
| 
 | 
 | ||||||
| {-# INLINABLE datep' #-} | {-# INLINABLE datep' #-} | ||||||
| 
 | 
 | ||||||
| -- | Parse a date and time in YYYY/MM/DD HH:MM[:SS][+-ZZZZ] format. | -- | Parse a date and time in YYYY-MM-DD HH:MM[:SS][+-ZZZZ] format. | ||||||
| -- Hyphen (-) and period (.) are also allowed as date separators. | -- Slash (/) and period (.) are also allowed as date separators. | ||||||
| -- The year may be omitted if a default year has been set. | -- The year may be omitted if a default year has been set. | ||||||
| -- Seconds are optional. | -- Seconds are optional. | ||||||
| -- The timezone is optional and ignored (the time is always interpreted as a local time). | -- The timezone is optional and ignored (the time is always interpreted as a local time). | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user