trevorld / r-ledger

Imports data from plain text accounting files
Other
39 stars 2 forks source link

Support hledger ISO date format #19

Closed chrislloyd closed 4 years ago

chrislloyd commented 4 years ago

As of hledger#1157, hledger outputs dates in ISO format with - instead of /.

Test Plan

~This PR is entirely unexecuted/untested ATM. Merge with caution.~ Tested locally - my dates import well.

trevorld commented 4 years ago

Thanks for bug report and patch!

I've updated the code to use something that should work with both the new change and also be reverse-compatible with older versions of hledger:

df <- mutate(df, date = as.Date(date, tryFormats = c("%Y-%m-%d", "%Y/%m/%d")))
chrislloyd commented 4 years ago

Great! Even better - thank you.