#prayer #times #muslim #shia

praytimes

Muslim prayer times calculation

2 stable releases

1.1.0 Nov 24, 2023
1.0.0 Sep 5, 2023

#864 in Math

33 downloads per month
Used in praytimes-kit

GPL-3.0 license

9.5MB
610 lines

praytimes

Prayer Times Calculator for Rust Based on Praytimes.org

Dont forget to give Praytimes.org based on their license :

TERMS OF USE:
	Permission is granted to use this code, with or
	without modification, in any website or application
	provided that credit is given to the original work
	with a link back to PrayTimes.org.

This program is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.

Installation

cargo add praytimes

Example

let calculator = &Calculator::new(
    methods::ISLAMIC_SOCIETY_OF_NORTH_AMERICA, // calculation method or parameters
    TuneOffsets {
        fajr: Some(7.0), // time for precaution
        ..Default::default()
    },
);
let output: PraytimesOutput = calculator
.calculate(
    &Location {
        longitude: 43.0,
        latitude: 30.0,
        elevation: 0.0, // elevation of that point in meters
    },
    &NaiveDate::from_ymd_opt(2022, 11, 11),
);

Docs

see lib.rs docs

Credits

PrayTimes.js is based on PrayTimes. Cities dataset from countries-states-cities-database.

Based on javascript refactor from time-pray

License

GNU GPL v3.0 - see LICENSE

Dependencies