egh / ledger-autosync

Synchronize your ledger-cli files with your bank.
GNU General Public License v3.0
273 stars 42 forks source link

Add date_format arg to specify format string for dates #95

Closed kevinjfoley closed 4 years ago

kevinjfoley commented 4 years ago

Tested against fixtures/checking.ofx and fixtures/paypal.csv with:

fixtures/checking.ofx
fixtures/checking.ofx -y "%Y-%m-%d"
fixtures/paypal.csv -a "test"
fixtures/paypal.csv -y "%Y-%m-%d" -a "test"
egh commented 4 years ago

Thanks very much @kevinjfoley ! This is great. Do you think we need the full date-format code, or would simply allowing - or / satisfy your use case? I know ledger allows any date format, but I'm curious how many people use non-standard date formats.

kevinjfoley commented 4 years ago

Thanks very much @kevinjfoley !

My pleasure!

Do you think we need the full date-format code, or would simply allowing - or / satisfy your use case?

My only use case for this is to be able to use - in my dates instead of / so some kind of option like date-separator would meet my needs.

However I figure allowing a full date format code gives more flexibility, some people may prefer %m/%d/%Y which this would allow for. Is there a downside to allowing a full code that you're worried about?

egh commented 4 years ago

@kevinjfoley It just seemed a little more complicated, but it does add the additional flexibility, so that's fine with me. Thanks again!