zkry / awqat

أوقات الصلاة
16 stars 5 forks source link

Fix some presets, and add new ones #6

Closed abougouffa closed 2 years ago

abougouffa commented 2 years ago

Summary

This PR includes several fixes and improvements.

1. Fix the angle for the Union des Organisations Islamiques de France

The right angle used by the 'French Muslims' (formerly known as Union des Organisations Islamiques de France) is 12° for both Fajr and Isha (references below).

I checked the times against my abougouffa/pyIslam library, and the mobile app I'm using. It gives correct times with 12°.

2. Fix a typo, and added some useful information to presets descriptions.

3. Add several presets

4. Fix Umm al-Qura University preset

As I described in issue #7, Umm al-Qura's method do not use an angle based calculation for Isha, instead, it adds a fixed amount of time after the Maghrib. The amount to be added is defined as follows:

5. Basic implementation of Midnight and One-Seventh of night methods

This implements the Midnight and One-Seventh of night methods, as described in literature [Odeh2009, Guessoum2010].

TODO

Calculate or determine if we are in the abnormal period or not. Currently, the method should be selected by the user manually. But it would be nicer to provide an angle based alternative in the normal period (when the astronomical signs of isha and fajr are visible.)

6. Add a way to format the mode line displayed string

In my Emacs installation, the Unicode symbols used in mode line are not displayed correctly. And to be honest, I didn't like the default format.

Screenshot_20220510_000251

So I would like to see something like this in upstream, so I can customize my mode line message.

I added a variable named awqat-mode-line-format to hold the format string. The format string is very simple, it can contain an arbitrary text with ${hours}, ${minutes}, and ${prayer}. The default value of awqat-mode-line-format expands to a string identical to the current format, so people upgrading awqat.el won't notice any difference until they customize their formatting string.

REFERENCES

zkry commented 2 years ago

JazakAllahu Khair! This is great work. With your knowledge, I think you'd be a good collaborator for this repo, and sent you an invite. Let me know if I can assist you with this PR.

abougouffa commented 2 years ago

Baraka Allahu Fika. Thank you for the invitation. I'll wait for your review, feel free to leave comments or request changes if you see a poorly written code.

abougouffa commented 2 years ago

I will assume it is ok to merge.