Code Monkey home page Code Monkey logo

Comments (6)

korbav avatar korbav commented on September 24, 2024

You can make use of the adjustments parameter for that.

let params = adhan.CalculationMethod.MuslimWorldLeague();
params.adjustments = { fajr: 10, sunrise: 10, dhuhr: 10, maghrib: 10, isha: 10 };

from adhan-js.

farisfaisalthena avatar farisfaisalthena commented on September 24, 2024

Dint realise this existed. Thanks

from adhan-js.

farisfaisalthena avatar farisfaisalthena commented on September 24, 2024

Is it possible to update the time in realtime? for example if user changes the adjustments time in settings i will have to restart the app. Can it be done automatically on change?

from adhan-js.

korbav avatar korbav commented on September 24, 2024

Is it possible to update the time in real time? for example, if user changes the adjustments time in settings i will have to restart the app. Can it be done automatically on change?

Your app must be able to trigger a recomputation without a restart, and then, accordingly updating the UI, which should not be a problem with any modern framework.

This library is built to give you only one calculation result, which makes sense since even if it would give you "real-time" results you would still have to have a timer to refresh the UI, so make use of this timer not only to update the UI but also to calculate again the prayers times :

Basic example:

let times;
const refreshUI = () => {
  if (null !== times) {
     // Do whatever with times variable
  }
}

setInterval(() => {
     times = new adhan.PrayerTimes(coordinates, date, params);
     refreshUI();
}, 60 * 1000);

from adhan-js.

atif089 avatar atif089 commented on September 24, 2024

@farisfaisalthena

Here's an interactive demo using ReactJS - https://8n5y0.csb.app/

from adhan-js.

github-actions avatar github-actions commented on September 24, 2024

Stale issue message

from adhan-js.

Related Issues (20)

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.