blaise-io/contribution

Off-by-one error still prevalent

Closed this issue · 5 comments

Hello, please take a look at this again. I tried using contribution recently and the off-by-one error is still there.
You can have a look at my contribution history graph to understand the issue better.

It's a great tool, and fixing this one caveat would make it flawless! Thanks in advance.

Thanks for reporting @swingcake. Was this on Windows? What is the time zone of your system?

I suspect it's something with time zones where https://github.com/blaise-io/contribution/blob/master/git.go#L174 is not processed. I should probably hard-code the date including time zone instead of relying on being able to set the environment's time zone and commit N days ago.

Thanks for reporting @swingcake.

Thanks for this project mate!

Was this on Windows? What is the time zone of your system?

I actually tried it on an Ubuntu VM (with Windows 10 as host), as well as on Windows 10 itself. Same issue. It might be because of time synchronisation in the guest VM with the host, thereby reproducing the same results.

My timezone is GMT+5:30.

I should probably hard-code the date including time zone

I think this should fix it, and I can't see any downsides that this approach might have.

Thanks for helping out. I was able to reproduce on macOS by changing my system's time zone to the far edges of the globe. I could no longer reproduce when sending the date with an rfc date that includes the time zone. Can you verify using 1.0.3?

WORKS PERFECTLY!

Good to hear, thanks for testing!