imp: journal: accept apply year as another synonym for Y (ledger compat)

This commit is contained in:
Simon Michael 2022-12-22 00:27:35 -10:00
parent 2357a7a750
commit c58b9e6ac9
3 changed files with 6 additions and 2 deletions

View File

@ -598,7 +598,7 @@ payeedirectivep = do
defaultyeardirectivep :: JournalParser m ()
defaultyeardirectivep = do
(string "Y" <|> string "year") <?> "default year"
(string "Y" <|> string "year" <|> string "apply year") <?> "default year"
lift skipNonNewlineSpaces
setYear =<< lift yearp

View File

@ -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` or `year` followed by the year. Eg:
specify a year. This is a line beginning with `Y` (or `year` or `apply year`) followed by the year. Eg:
```journal
Y2009 ; set default year to 2009

View File

@ -24,11 +24,15 @@ Y 1111
1/1
year 2222
2/2
apply year 3333
3/3
$ hledger -f- print
1111-01-01
2222-02-02
3333-03-03
>=
# Legacy ! and @ prefixes are accepted.