mikereedell / sunrisesunsetlib-java

Library for computing the sunrise/sunset from GPS coordinates and a date, in Java.
http://mikereedell.github.com/sunrisesunsetlib-java/
Apache License 2.0
299 stars 69 forks source link

Issue in algorithm for convert time from Decimal to calendar #2

Closed wild-swift closed 12 years ago

wild-swift commented 12 years ago

If local time variable will be less then 0, in method SolarEventCalculator.getLocalTimeAsCalendar(), result will be incorrect.

mikereedell commented 12 years ago

Thanks for reporting this.

Do you have a use case for the error? I can duplicate it in a unit test but can't replicate the condition using real-world test data.

wild-swift commented 12 years ago

I found this issue when I tried to calculate official sunrise time for my place (Novosibirsk, Russia) yesterday. latitude = 55.03 longitude = 82.91 date = 07 may 2012 correct sunrise time is 22:35 GMT

mikereedell commented 12 years ago

The latest commit fixes this issue.

-Mike