prayerutils - v1.3.0

Release License Github Version codecov

Prayer Times Calculator

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:

  • [ ] Documentation for v1 [In Progress]
  • Modernized codebase with better TypeScript support
  • Improved API design for easier integration
  • Enhanced documentation and examples
  • Additional features and customization options

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

  • Calculate prayer times for any location
  • Support for different calculation methods
  • Adjustable calculation parameters
  • Tune times by given offsets

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 method
  • adjust(parameters) - Adjust calculation parameters
  • tune(offsets) - Tune times by given offsets
  • getMethod() - Get calculation method
  • getSetting() - Get current calculation parameters
  • getOffsets() - Get current time offsets
  • adjustAsrMethod() - 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.