Open mefromthepast opened 3 years ago
This should already be supported by using --date-format '[[%y-]%m-]%d'
or the config option date-format = '[[%y-]%m-]%d'
.
We should make it the default now that hledger switched, but that would break people's muscle memory. Unfortunately, the current date parser in iadd
doesn't support accepting -
or /
as separator, you have to choose one.
I think it would be useful to note for others who see this issue that what is currently not supported is manually entering dates in YYYY-MM-DD
format in the Date
field in hledger-iadd
.
But when dates that are added in YYYY/MM/DD
format in hledger-iadd
, it automatically ends up in the journal file as YYYY-MM-DD
even though visually in hledger-iadd
it shows YYYY/MM/DD
.
I think it would be useful to note for others who see this issue that what is currently not supported is manually entering dates in
YYYY-MM-DD
format in theDate
field inhledger-iadd
.
Sure it's possible with the config option or command line flag, see my comment above.
But when dates that are added in
YYYY/MM/DD
format inhledger-iadd
, it automatically ends up in the journal file asYYYY-MM-DD
even though visually inhledger-iadd
it showsYYYY/MM/DD
.
hledger-add
always shows a preview of the date in hledger's default format. So you should by default see YYYY-MM-DD
everywhere execpt the input itself. With the above mentioned config, not even there.
The problem here is not that it's not supported, but that it's not the default. However, this can't easily be changed in a backwards compatible way and I'd like to avoid breaking existing users muscle memory.
Thanks for that clarification, and correcting the issue title! I misread this:
the current date parser in
iadd
doesn't support accepting - or / as separator, you have to choose one.
I didn't realize it meant "the current date parser doesn't support accepting both -
and /
as separators: you have to choose one or the other." But your subsequent reply makes this clear.
hledger has switched to it as its default date format, so I would welcome if hledger-iadd would support it as well.
DD
,MM-DD
, orYYYY-MM-DD
respectively, with the option to skip leading 0s just as hledger-iadd is working right now withYYYY/MM/DD
.