batoulapps / adhan-kotlin

High precision Islamic prayer time library for Java
MIT License
161 stars 47 forks source link

Milliseconds difference for the same prayer #50

Closed alaa-moataz closed 1 year ago

alaa-moataz commented 1 year ago

Hello,

Thank you for implementing this library it's really helpful, I noticed one issue is that the milliseconds part of any returned date for prayers can differ given the same Coordinates , Date & CalculationParameters

The code below outputs "Max is 1681351380999 and min is 1681351380000"

image

I think in your TimeComponents.java in dateComponents function you should add calendar.set(Calendar.MILLISECOND, 0)

sgtsquiggs commented 1 year ago

Thanks for finding this issue - we'll get around to fixing this ourselves but sooner if you would create a PR for this change (with an additional unit test)! We'd appreciate it!

ahmedre commented 1 year ago

Nice find! Will fix this for both the Java and Kotlin versions probably this weekend (unless @sgtsquiggs gets to it first).

alaa-moataz commented 1 year ago

@sgtsquiggs @ahmedre I can create a PR for it today

ahmedre commented 1 year ago

JazakumAllah khairan