islam is an Islamic library for Rust. It is a direct port of PyIslam with a slight change in the API part.
Why?
I have always got panic!
working with salah.
Previously, I have good experience with PyIslam.
In my case, it is very precise and has a simple algorithm. Nowadays, I work a lot with Rust.
So here it is, islam
is born!
Features
- Hijri date
- Prayer times
Usage
Getting Prayer Times
// GMT+7
let timezone = 7;
// https://www.mapcoordinates.net/en
let jakarta_city = new;
let date = Local.ymd;
let config = new.with;
let prayer_times = new
.on
.with_config
.calculate;
First, you need to specify Location
with latitude, longitude, timezone
as
parameters.
Then choose a calculation method such Singapore
. Other methods available in the
docs.
There are also madhab
configurations that you can choose from.
Getting Hijri Date
let from_gregorian = from_gregorian;
println!;
from_gregorian
accepts Date
and correction value
as parameters.
More Examples
To learn more, see other examples.
Contributing
For reporting issues, visit the tracker here: https://todo.sr.ht/~azzamsa/islam
Please send patches to ~azzamsa/public-inbox@lists.sr.ht
Acknowledgement
The calculation part of this library is a direct port of PyIslam with a slight change in the API part. The API took inspiration from salah