Comments (6)
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.
Dint realise this existed. Thanks
from adhan-js.
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.
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.
Here's an interactive demo using ReactJS - https://8n5y0.csb.app/
from adhan-js.
Stale issue message
from adhan-js.
Related Issues (20)
- Prayer Ending Times HOT 1
- Understanding the functionality of nextPrayer and currentPrayer HOT 2
- Moon Phases?
- Wrong time returned HOT 1
- [suggestion]: Use `const enums` for some constant variables
- time difference for asr on Turkey HOT 1
- The use of Temporal HOT 2
- [suggestion]: Add 'Imsak' Timings HOT 4
- Host the javascript on cdnjs or similar HOT 1
- Turkish Diyanet times for Netherlands gives wrong for yatsi time
- Reason for using sth like moment.js HOT 2
- Taking elevation into account for prayer times HOT 1
- Considering elevation for Salah times HOT 21
- TypeError: Cannot read properties of undefined (reading 'getTime') HOT 1
- add adjustment settings to sunset HOT 6
- Prayer times are wrong(?) HOT 16
- The possibility of adjusting the midnight time HOT 1
- Calculation is returning prayer times for next day instead of "today" HOT 3
- Getting Default Calculation Method for Location
- Wrong times HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adhan-js.