Coder Social home page Coder Social logo

prayer-times-moonsighting's Introduction

CircleCI Releases

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

composer install islamic-network/prayer-times-moonsighting

Usage

To calculate Fajr minutes before sunrise:

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:

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:

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/.

prayer-times-moonsighting's People

Contributors

meezaan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.