Fix wrong fajr and sunrise time#2
Conversation
azzamsa
commented
Sep 26, 2020
|
Thank you so much for the pull request. Would you be able to add a test or two around this issue that is being addressed? |
|
My PR mostly contains @RagibHasin works. IMHO, I think It's better for Ragib to open A PR himself. Since he did a lot of improvement. |
|
Sorry for delayed response. I'm having problem with internet connection. I think I can open a PR tomorrow with the requested test cases included. Thanks everyone. |
|
@azzamsa and @RagibHasin I have reviewed the pull request. It is fine to go; but I would like to have the tests incorporated before it is merged. Let me know if this is possible and we will proceed accordingly. Edit.1: I have reopened the original issue and linked to this pull request. Once the request is merged that issue will be closed out automatically. Edit.2: I am stating the obvious and also just want to make sure that the issue is not that local and UTC times were being compared. Correct? Because the library only outputs results in UTC; which then will need to be converted to local time. |
|
@insha Actually the problem mainly revolves around UTC and local dates. For instance, today Fajr time in Rajshahi, BD is 4:46 AM Local and Yesterday 10:46 PM UTC. This situation causes Ideally I thought we should make this library generic over time zone for public API. But no time zone implements But beware, this would cause My PR may come today or at most tomorrow, in sha Allah. |
|
A little bit of story: I am developing the CLI salah app on top of this. At first, it has 3 problems:
In uptosniff branch, Ragib solves the 3 mentioned issues and refactor the code to be more idiomatic. That PR is indeed huge, I don't have any idea if you can accept it. |
|
@azzamsa Please bear with me while I try to understand and work through each of the issues.
This is fine.
This is interesting. The library is expecting a UTC date, therefore, when passing in the date for the calculation the client needs to take the local date and convert it to UTC before passing it on to the library. And once the result is received the client needs to convert the resulting times for each of the prayers to the desired local time from the provided UTC time. The use of UTC is stated in the readme file, here, and here. The use of UTC is required because there is too much idiosyncrasies between time zones. UTC provides a consistent and stable date for all calculations. Therefore, I am of the opinion that the consumers of this library should be handling this complexity rather than the library itself. The main reason being that the handling of local time zone is dependent on the system that the client is targeting and supporting; thus it should be the client's responsibility to do the appropriate conversion.
Indeed, this PR is large and is addressing multiple issues. It would be best to break this down into individual pull requests for each of the issues. If you haven't already please take a look at the contributing guide for this project. |
|
Closing this merge request due to inactivity. |