Based on PrayTimes.js: Prayer Times Calculator (ver 2.3)
In future major versions, this library will undergo a significant refactor to enhance usability and performance. The planned improvements include:
Stay tuned for updates and new releases!
PrayTimes.js is originally a JavaScript library for calculating Islamic prayer times. It is developed by Hamid Zarrabi-Zadeh and is distributed under the GNU LGPL v3.0 license.
This Typescript port by mohdsabahat
To use PrayerTimes in your project, include the library in your HTML file:
<script src="path/to/build.js"></script>
let PT = new PrayerUtils.PrayerTimes('Karachi');
var times = PT.getTimes(new Date(), [43, -80], -5);
console.log('Sunrise = ' + times.sunrise);
getTimes(date, coordinates [, timeZone [, dst [, timeFormat]]])setMethod(method) - Set calculation methodadjust(parameters) - Adjust calculation parameterstune(offsets) - Tune times by given offsetsgetMethod() - Get calculation methodgetSetting() - Get current calculation parametersgetOffsets() - Get current time offsetsadjustAsrMethod() - Adjust Asr calculation method, accepted values ['Standard', 'Hanafi']For detailed documentation, please refer to the User's Manual and Calculation Formulas.
PrayTimes.js is licensed under the GNU LGPL v3.0. For more information, please refer to the license terms.
PrayTimes.js: Prayer Times Calculator (ver 2.3)
Copyright (C) 2007-2011 PrayTimes.org
Developer: Hamid Zarrabi-Zadeh
License: GNU LGPL v3.0
TERMS OF USE:
Permission is granted to use this code, with or
without modification, in any website or application
provided that credit is given to the original work
with a link back to PrayTimes.org.
This program is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY.
PLEASE DO NOT REMOVE THIS COPYRIGHT BLOCK.