mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-19 10:17:35 +03:00
imp: journal: accept year
as a synonym for Y
(ledger compat)
This commit is contained in:
parent
826a7cfb2a
commit
95d7679f6d
@ -575,7 +575,7 @@ payeedirectivep = do
|
||||
|
||||
defaultyeardirectivep :: JournalParser m ()
|
||||
defaultyeardirectivep = do
|
||||
char 'Y' <?> "default year"
|
||||
(string "Y" <|> string "year") <?> "default year"
|
||||
lift skipNonNewlineSpaces
|
||||
setYear =<< lift yearp
|
||||
|
||||
|
@ -2641,7 +2641,7 @@ and less trustworthy in an audit.
|
||||
### Default year
|
||||
|
||||
You can set a default year to be used for subsequent dates which don't
|
||||
specify a year. This is a line beginning with `Y` followed by the year. Eg:
|
||||
specify a year. This is a line beginning with `Y` or `year` followed by the year. Eg:
|
||||
|
||||
```journal
|
||||
Y2009 ; set default year to 2009
|
||||
@ -2650,7 +2650,7 @@ Y2009 ; set default year to 2009
|
||||
expenses 1
|
||||
assets
|
||||
|
||||
Y2010 ; change default year to 2010
|
||||
year 2010 ; change default year to 2010
|
||||
|
||||
2009/1/30 ; specifies the year, not affected
|
||||
expenses 1
|
||||
|
@ -18,3 +18,14 @@ a:b
|
||||
aa:b
|
||||
c
|
||||
|
||||
<
|
||||
Y 1111
|
||||
1/1
|
||||
year 2222
|
||||
2/2
|
||||
$ hledger -f- print
|
||||
1111-01-01
|
||||
|
||||
2222-02-02
|
||||
|
||||
>=
|
||||
|
@ -130,13 +130,6 @@ $ hledger -f- check
|
||||
>2//
|
||||
>=1
|
||||
|
||||
# `year`/`Y` set the year for year-less dates
|
||||
<
|
||||
year 2022
|
||||
$ hledger -f- check
|
||||
>2//
|
||||
>=1
|
||||
|
||||
# `C AMT1 = AMT2` declare a commodity equivalency
|
||||
<
|
||||
C $ 1 USD
|
||||
@ -151,3 +144,7 @@ o 2013/04/05 13:30:00
|
||||
$ hledger -f- check
|
||||
>2//
|
||||
>=1
|
||||
|
||||
# amount expressions
|
||||
|
||||
# lot notation
|
||||
|
@ -33,3 +33,16 @@ $ hledger -f- check
|
||||
(budget:food) *-1
|
||||
|
||||
$ hledger -f- check
|
||||
|
||||
# `Y`/`year` set the year for year-less dates
|
||||
<
|
||||
Y 1111
|
||||
1/1
|
||||
year 2222
|
||||
2/2
|
||||
$ hledger -f- print
|
||||
1111-01-01
|
||||
|
||||
2222-02-02
|
||||
|
||||
>=
|
||||
|
Loading…
Reference in New Issue
Block a user