Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixed year handling in macOS date formats #477
I have set the system date format to yyyy-MM-dd on my Mac, but when I started using moneyGuru, I found that it would produce dates of the form dd-MM-yyyy instead. The reason for this is that macOS (and possibly others) use a single 'y' to denote a non-zerofilled complete year. moneyGuru didn't recognize this and defaulted to its fallback format instead.
Fixed by substituting 'yyyy' for 'y' before parsing the format string. This will give us zero filled centuries for years < 1000, but that's about as close as we can get giving strftime's limitations. Hopefully, there's no real need to process historic accounting records for Roman times anyway.
Thanks! I can confirm the problem and the fix. moneyGuru has very good test coverage and there's usually always an automated test coming with features like this. Would you mind writing one? I'd be happy to assist if you're uncomfortable with this.