Git Product home page Git Product logo

kurdistan-prayer-times-js's Introduction

kurdistan prayer times js library

Cities list

  • sulaymaniyah

  • erbil

  • kirkuk

  • taqtaq

  • akre

  • duhok

  • halabja

  • jalawla

  • khanaqin

  • qaraHanjir

  • shekhan

  • tuzKhurma

  • zakhoo

install

npm i kurdistan-prayer-times

how to use it

import KUprayer from 'kurdistan-prayer-times'

For Vanila Js import from cdn to your js file

import KUprayer from 'https://cdn.jsdelivr.net/npm/[email protected]/index.es.js'

or

import KUprayer from 'kurdistan-prayer-times/index.es.js'

if you recieve Failed to resolve module specifier error then

select node_modules from your project folder

import KUprayer from "../../../node_modules/kurdistan-prayer-times/index.es.js";

Get The Prayer Data

pass a string of city name from above list and call date function

('Today' or 'Tomorrow' or 'ThisMonth') pass one of these strings

import KUprayer from 'kurdistan-prayer-times'

const { res } = KUprayer('sulaymaniyah').date('Today')

console.log(res)
// result

// TodayPrayer: {
// Fajr: '3:12',
// Sunrise: '4:45',
// Dhuhr: '12:06',
// Asr: '15:52',
// Maghrib: '19:21',
// Isha: '20:31'
// },
// nowPrayer: { Time: '', Name: '' },
// nextPrayer: { Time: '12:06', Name: 'Dhuhr' },
// city: 'sulaymaniyah'

Fotmat the Times

by default is 24 pass a string or num ( 12 ) to format function format function work only with today function

const { res } = KUprayer('sulaymaniyah').format('12').date('Today')

// note that format function  must be before date function

console.log(res)

// result

// TodayPrayer: {
// Fajr: '3:12 AM',
// Sunrise: '4:45 AM',
// Dhuhr: '12:06 PM',
// Asr: '3:52 PM',
// Maghrib: '7:21 PM',
// Isha: '8:31 PM'
// },
// nowPrayer: { Time: '', Name: '' },
// nextPrayer: { Time: '3:12', Name: 'Fajr' },
// city: 'sulaymaniyah'

All Days / Month

const { res } = KUprayer('sulaymaniyah').allDays()

console.log(res)

// result
// {
// day: '9',
// id: 9,
// month: '1',
// time: [ '5:45', '7:06', '12:09', '14:48', '17:09', '18:19' ]
// },
// {
// day: '10',
// id: 10,
// month: '1',
// time: [ '5:45', '7:06', '12:10', '14:49', '17:10', '18:20' ]
// },
// ....

give a star if it was useful

kurdistan-prayer-times-js's People

Stargazers

 avatar  avatar

Watchers

 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.