npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

islamic-adhan

v1.0.8

Published

Function to return Pray times or adhan times in any place in the world

Downloads

23

Readme

Adhan.ts

It's a Function returns Pray times or adhan times in any place in the world

Installation

npm install --save islamic-adhan or yarn add --save islamic-adhan

How To Use

  1. You Must Know Your lattitude & longitude.
  2. You Must Know Your time zone number for example 2 refres to gmt+2 & 3 refers to gmt+3.... but if you are in this location you don't have to add time zone you can leave it "auto".
  3. You Must Know your calculation method for your region & country. to know search on google. for example What is the salah calculation method for Egypt

Our Calculation Methods

{
    MWL: {
      name: "Muslim World League",
      params: { fajr: 18, isha: 17 },
    },
    ISNA: {
      name: "Islamic Society of North America (ISNA)",
      params: { fajr: 15, isha: 15 },
    },
    Egypt: {
      name: "Egyptian General Authority of Survey",
      params: { fajr: 19.5, isha: 17.5 },
    },
    Makkah: {
      name: "Umm Al-Qura University, Makkah",
      params: { fajr: 18.5, isha: "90 min" },
    }, // fajr was 19 degrees before 1430 hijri
    Karachi: {
      name: "University of Islamic Sciences, Karachi",
      params: { fajr: 18, isha: 18 },
    },
    Tehran: {
      name: "Institute of Geophysics, University of Tehran",
      params: { fajr: 17.7, isha: 14, maghrib: 4.5, midnight: "Jafari" },
    }, // isha is not explicitly specified in this method
    Jafari: {
      name: "Shia Ithna-Ashari, Leva Institute, Qum",
      params: { fajr: 16, isha: 14, maghrib: 4, midnight: "Jafari" },
    },
  }

Examples

if you got those three data ? you will get the prayer times accurately

Example 1

import { Adhan } from "adhan.ts";

const Prayer = new Adhan("Egypt");

// Egypt, Alexandria;
let latitude = 31.223;
let longitude = 30.0355;

const times = Prayer.getTimes(
  new Date() /* the Date */,
  [latitude, longitude],
  "auto" /* => timezone */
);

console.log(times);

Output

{
  imsak: { iso: 2023-01-25T23:12:00.495Z, formatedTime: '06:15' },
  fajr: { iso: 2023-01-25T23:12:00.495Z, formatedTime: '06:25' },
  sunrise: { iso: 2023-01-25T23:12:00.495Z, formatedTime: '07:56' },
  dhuhr: { iso: 2023-01-25T23:12:00.495Z, formatedTime: '13:12' },
  asr: { iso: 2023-01-25T23:12:00.495Z, formatedTime: '16:09' },
  sunset: { iso: 2023-01-25T23:12:00.495Z, formatedTime: '18:29' },
  maghrib: { iso: 2023-01-25T23:12:00.495Z, formatedTime: '18:29' },
  isha: { iso: 2023-01-25T23:12:00.495Z, formatedTime: '19:51' },
  midnight: { iso: 2023-01-25T23:12:00.495Z, formatedTime: '01:12' }
}

Example 2

import { Adhan } from "adhan.ts";

const Prayer = new Adhan("Egypt");

// Jordan, Oman;
let latitude = 31.95806;
let longitude = 35.93528;

const times = Prayer.getTimes(
  new Date() /* the Date */,
  [latitude, longitude],
  "auto" /* => timezone */
);

Output

{
  imsak: { iso: 2023-01-25T22:49:00.834Z, formatedTime: '05:57' },
  fajr: { iso: 2023-01-25T22:49:00.834Z, formatedTime: '06:07' },
  sunrise: { iso: 2023-01-25T22:49:00.834Z, formatedTime: '07:33' },
  dhuhr: { iso: 2023-01-25T22:49:00.834Z, formatedTime: '12:49' },
  asr: { iso: 2023-01-25T22:49:00.834Z, formatedTime: '15:44' },
  sunset: { iso: 2023-01-25T22:49:00.834Z, formatedTime: '18:04' },
  maghrib: { iso: 2023-01-25T22:49:00.834Z, formatedTime: '18:04' },
  isha: { iso: 2023-01-25T22:49:00.834Z, formatedTime: '19:34' },
  midnight: { iso: 2023-01-25T22:49:00.834Z, formatedTime: '00:49' }
}