UNPKG

salat-first

Version:

Islamic prayer times calculation with special support for Moroccan methods and Maliki madhab

33 lines (32 loc) 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createCustomParameters = createCustomParameters; const index_1 = require("./index"); const calculator_1 = require("../prayers/calculator"); const madhab_1 = require("../madhab"); /** * Creates a new custom calculation parameters object * @param fajrAngle The angle of the sun below the horizon for Fajr * @param ishaAngle The angle of the sun below the horizon for Isha * @param madhab The madhab to use for Asr calculation * @param adjustments Custom time adjustments in minutes * @returns The custom calculation parameters */ function createCustomParameters(fajrAngle, ishaAngle, madhab = madhab_1.Madhab.Shafi, adjustments = {}) { // Create parameters with custom angles const params = new calculator_1.CalculationParameters(index_1.CalculationMethod.Custom, fajrAngle, ishaAngle, 0, // No Isha interval 0 // No Maghrib angle ); // Set madhab params.madhab = madhab; // Set custom adjustments params.adjustments = { fajr: adjustments.fajr || 0, sunrise: adjustments.sunrise || 0, dhuhr: adjustments.dhuhr || 0, asr: adjustments.asr || 0, maghrib: adjustments.maghrib || 0, isha: adjustments.isha || 0, }; return params; }