2016-04-28 23:23:20 +03:00
|
|
|
# 1. posting dates can be set with a tag. Also the year can be
|
|
|
|
# inferred from the transaction. If there are multiple tags, the first
|
|
|
|
# is used. Date separators /-. are allowed.
|
|
|
|
hledger -f- register
|
|
|
|
<<<
|
|
|
|
2000/1/2
|
|
|
|
a 0 ; date: 3/4, date: 4-5, date:6.7
|
2020-01-06 18:41:00 +03:00
|
|
|
>>> /^2000-03-04/
|
2016-04-28 23:23:20 +03:00
|
|
|
>>>=0
|
|
|
|
|
|
|
|
# 2. If the date: or date2: tags do not have a valid simple date
|
|
|
|
# value, there should be a corresponding error at the right position
|
|
|
|
hledger -f- register
|
|
|
|
<<<
|
|
|
|
comment
|
|
|
|
Journal comment to prevent this being parsed as a timedot file
|
|
|
|
end comment
|
|
|
|
|
|
|
|
2000/1/1
|
|
|
|
a 0 ; date: 3.31
|
|
|
|
|
|
|
|
2000/1/2
|
|
|
|
b 0
|
|
|
|
; date: 3.32
|
|
|
|
|
2018-06-06 20:15:38 +03:00
|
|
|
>>>2 /10:16/
|
2016-04-28 23:23:20 +03:00
|
|
|
>>>=1
|
|
|
|
|
|
|
|
# 3. Ledger's bracketed date syntax is also supported: `[DATE]`,
|
|
|
|
# `[DATE=DATE2]` or `[=DATE2]`. This is equivalent to using `date:` or
|
|
|
|
# `date2:` tags.
|
|
|
|
hledger -f- register --date2
|
|
|
|
<<<
|
|
|
|
2000/1/2
|
|
|
|
a 0 ; [=3-4]
|
2020-01-06 18:41:00 +03:00
|
|
|
>>> /^2000-03-04/
|
2016-04-28 23:23:20 +03:00
|
|
|
>>>=0
|
|
|
|
|
|
|
|
# 4. Date parsing and error reporting activates for square brackets
|
|
|
|
# containing only `0123456789/-.=` characters.
|
|
|
|
hledger -f- register
|
|
|
|
<<<
|
|
|
|
comment
|
|
|
|
Journal comment to prevent this being parsed as a timedot file
|
|
|
|
end comment
|
|
|
|
|
|
|
|
2000/1/2
|
|
|
|
a 0 ; [3/4 ] space, causes this to be ignored
|
|
|
|
|
|
|
|
2000/1/2
|
|
|
|
b 0 ; [1/1=1/2/3/4] bad second date, should error
|
|
|
|
|
2018-05-23 05:17:51 +03:00
|
|
|
>>>2 /9:23/
|
2016-04-28 23:23:20 +03:00
|
|
|
>>>=1
|