https://github.com/islamic-network/prayer-times-moonsighting
A prayer times library to calculate Fajr and Isha timings per moonsighting.com
https://github.com/islamic-network/prayer-times-moonsighting
Last synced: 12 months ago
JSON representation
A prayer times library to calculate Fajr and Isha timings per moonsighting.com
- Host: GitHub
- URL: https://github.com/islamic-network/prayer-times-moonsighting
- Owner: islamic-network
- Created: 2020-07-22T05:07:37.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-27T19:42:04.000Z (over 2 years ago)
- Last Synced: 2024-11-18T09:12:50.903Z (over 1 year ago)
- Language: PHP
- Size: 633 KB
- Stars: 7
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/islamic-network/prayer-times-moonsighting/releases)

[](https://cairo.mamluk.net/teams/islamic-network/pipelines/prayer-times-moonsighting)
# This repository is no longer active. Please see https://community.islamic.network/d/140-removing-repositories-from-github.
# PHP Library to Calculate Fajr and Isha Timings per MoonSighting.com
This library has been written for the AlAdhan.com API @ https://aladhan.com/prayer-times-api and is included in the main prayer times library @ https://github.com/islamic-network/prayer-times.
## Requirements
* PHP 7.3+
## Install
```php
composer install islamic-network/prayer-times-moonsighting
```
## Usage
To calculate Fajr minutes before sunrise:
```php
use IslamicNetwork\MoonSighting\Fajr;
use DateTime;
$date = new DateTime('24-12-2020');
$pt = new Fajr($date, 25.2119894);
$pt->getMinutesBeforeSunrise(); // 88 minutes
```
To calculate Isha minutes after sunset:
```php
use IslamicNetwork\MoonSighting\Fajr;
use DateTime;
$date = new DateTime('24-12-2020');
$pt = new Isha($date, 25.2119894, 'general'); // The third parameter is shafaq, acceptable values for which are 'general', 'ahmer', 'abyad'.
$pt->getMinutesAfterSunset(); // 86 minutes
```
## Tests
To run unit tests, from the root of this repository execute:
```php
vendor/bin/phpunit tests/Unit/
```
## Credits
Syed Khalid Shaukat, who has done the research for this method of computing timings for higher latitude areas. For more information about the calculation,
please see the Fajr and Isha booklet @ https://github.com/islamic-network/prayer-times-moonsighting/blob/master/booklet-fajr-isha.pdf and visit https://www.moonsighting.com/.