From 0041629e7ecad5b999a3b382f79314d5d8a0e4b3 Mon Sep 17 00:00:00 2001 From: Ameir Al-Zoubi Date: Sat, 1 Jan 2022 22:37:47 -0500 Subject: [PATCH] fix(prayer times): fix polar circle prayer times We are no longer resetting the date of the prayer time date property when `AqrabYaum` is used. This fixes an issue with night portion calculations and keeps the prayer times on the correct calendar day so that any countdown or ordering logic would still work correctly. --- .nvmrc | 1 + Adhan.js | 5 +---- Adhan.js.map | 2 +- example.html | 22 ++++++++++++---------- src/PrayerTimes.js | 5 +---- test/adhan.test.js | 17 +++++++++++++++++ 6 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..ff65059 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v16.13.0 diff --git a/Adhan.js b/Adhan.js index 706235c..5be907f 100644 --- a/Adhan.js +++ b/Adhan.js @@ -784,16 +784,13 @@ class PrayerTimes_PrayerTimes { dhuhrTime = new TimeComponents(solarTime.transit).utcDate(date.getFullYear(), date.getMonth(), date.getDate()); sunriseTime = new TimeComponents(solarTime.sunrise).utcDate(date.getFullYear(), date.getMonth(), date.getDate()); let sunsetTime = new TimeComponents(solarTime.sunset).utcDate(date.getFullYear(), date.getMonth(), date.getDate()); - let tomorrow = dateByAddingDays(date, 1); + const tomorrow = dateByAddingDays(date, 1); let tomorrowSolarTime = new SolarTime_SolarTime(tomorrow, coordinates); const polarCircleResolver = calculationParameters.polarCircleResolution; if ((!isValidDate(sunriseTime) || !isValidDate(sunsetTime) || isNaN(tomorrowSolarTime.sunrise)) && polarCircleResolver !== PolarCircleResolution.Unresolved) { const resolved = polarCircleResolvedValues(polarCircleResolver, date, coordinates); - this.coordinates = resolved.coordinates; - this.date.setTime(resolved.date.getTime()); solarTime = resolved.solarTime; - tomorrow = resolved.tomorrow; tomorrowSolarTime = resolved.tomorrowSolarTime; const dateComponents = [date.getFullYear(), date.getMonth(), date.getDate()]; dhuhrTime = new TimeComponents(solarTime.transit).utcDate(...dateComponents); diff --git a/Adhan.js.map b/Adhan.js.map index aef3da2..c0fce84 100644 --- a/Adhan.js.map +++ b/Adhan.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://adhan/webpack/universalModuleDefinition","webpack://adhan/webpack/bootstrap","webpack://adhan/./src/Coordinates.js","webpack://adhan/./src/MathUtils.js","webpack://adhan/./src/Rounding.js","webpack://adhan/./src/DateUtils.js","webpack://adhan/./src/Shafaq.js","webpack://adhan/./src/Astronomical.js","webpack://adhan/./src/SolarCoordinates.js","webpack://adhan/./src/SolarTime.js","webpack://adhan/./src/TimeComponents.js","webpack://adhan/./src/Prayer.js","webpack://adhan/./src/Madhab.js","webpack://adhan/./src/PolarCircleResolution.js","webpack://adhan/./src/PrayerTimes.js","webpack://adhan/./src/HighLatitudeRule.js","webpack://adhan/./src/CalculationParameters.js","webpack://adhan/./src/CalculationMethod.js","webpack://adhan/./src/Qibla.js","webpack://adhan/./src/SunnahTimes.js","webpack://adhan/./src/Adhan.js"],"names":["Coordinates","constructor","latitude","longitude","degreesToRadians","degrees","Math","PI","radiansToDegrees","radians","normalizeToScale","number","max","floor","unwindAngle","angle","quadrantShiftAngle","round","Rounding","Nearest","Up","None","dateByAddingDays","date","days","year","getFullYear","month","getMonth","day","getDate","hours","getHours","minutes","getMinutes","seconds","getSeconds","Date","dateByAddingMinutes","dateByAddingSeconds","getTime","roundedMinute","rounding","getUTCSeconds","offset","dayOfYear","returnedDayOfYear","feb","Astronomical","isLeapYear","months","i","isValidDate","isNaN","valueOf","Shafaq","General","Ahmer","Abyad","meanSolarLongitude","julianCentury","T","term1","term2","term3","pow","L0","meanLunarLongitude","Lp","ascendingLunarNodeLongitude","term4","Omega","meanSolarAnomaly","M","solarEquationOfTheCenter","meanAnomaly","Mrad","sin","apparentSolarLongitude","meanLongitude","Lambda","meanObliquityOfTheEcliptic","apparentObliquityOfTheEcliptic","Epsilon0","O","cos","meanSiderealTime","JD","Theta","nutationInLongitude","solarLongitude","lunarLongitude","ascendingNode","nutationInObliquity","altitudeOfCelestialBody","observerLatitude","declination","localHourAngle","Phi","delta","H","asin","approximateTransit","siderealTime","rightAscension","L","Theta0","a2","Lw","correctedTransit","previousRightAscension","nextRightAscension","m0","a1","a3","a","interpolateAngles","dm","correctedHourAngle","coordinates","afterTransit","previousDeclination","nextDeclination","h0","d2","d1","d3","H0","acos","m","interpolate","h","y2","y1","y3","n","b","c","julianDay","trunc","x","ceil","Y","D","A","B","i0","i1","seasonAdjustedMorningTwilight","sunrise","abs","d","adjustment","dyy","daysSinceSolstice","seasonAdjustedEveningTwilight","sunset","shafaq","northernOffset","southernOffset","daysInYear","SolarCoordinates","dPsi","dEpsilon","EpsilonApparent","atan2","apparentSiderealTime","SolarTime","observer","solar","prevSolar","nextSolar","solarAltitude","approxTransit","transit","hourAngle","afternoon","shadowLength","tangent","inverse","tan","atan","TimeComponents","utcDate","UTC","Prayer","Fajr","Sunrise","Dhuhr","Asr","Maghrib","Isha","Madhab","Shafi","Hanafi","madhab","PolarCircleResolution","AqrabBalad","AqrabYaum","Unresolved","LATITUDE_VARIATION_STEP","UNSAFE_LATITUDE","isValidSolarTime","solarTime","aqrabYaumResolver","daysAdded","direction","testDate","setDate","tomorrow","tomorrowSolarTime","aqrabBaladResolver","sign","polarCircleResolvedValues","resolver","defaultReturn","PrayerTimes","calculationParameters","fajrTime","sunriseTime","dhuhrTime","asrTime","maghribTime","ishaTime","nightFraction","sunsetTime","polarCircleResolver","polarCircleResolution","resolved","setTime","dateComponents","tomorrowSunrise","night","fajrAngle","method","safeFajr","portion","nightPortions","fajr","ishaInterval","ishaAngle","safeIsha","isha","maghribAngle","angleBasedMaghrib","fajrAdjustment","adjustments","methodAdjustments","sunriseAdjustment","dhuhrAdjustment","dhuhr","asrAdjustment","asr","maghribAdjustment","maghrib","ishaAdjustment","timeForPrayer","prayer","currentPrayer","nextPrayer","HighLatitudeRule","MiddleOfTheNight","SeventhOfTheNight","TwilightAngle","recommended","CalculationParameters","methodName","highLatitudeRule","CalculationMethod","MuslimWorldLeague","params","Egyptian","Karachi","UmmAlQura","Dubai","MoonsightingCommittee","NorthAmerica","Kuwait","Qatar","Singapore","Tehran","Turkey","Other","qibla","makkah","SunnahTimes","prayerTimes","nextDay","nextDayPrayerTimes","nightDuration","middleOfTheNight","lastThirdOfTheNight","adhan","Qibla"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFe,MAAMA,WAAN,CAAkB;AAC7BC,aAAW,CAACC,QAAD,EAAWC,SAAX,EAAsB;AAC7B,SAAKD,QAAL,GAAgBA,QAAhB;AACA,SAAKC,SAAL,GAAiBA,SAAjB;AACH;;AAJ4B,C;;ACA1B,SAASC,gBAAT,CAA0BC,OAA1B,EAAmC;AACtC,SAAQA,OAAO,GAAGC,IAAI,CAACC,EAAhB,GAAsB,KAA7B;AACH;AAEM,SAASC,gBAAT,CAA0BC,OAA1B,EAAmC;AACtC,SAAQA,OAAO,GAAG,KAAX,GAAoBH,IAAI,CAACC,EAAhC;AACH;AAEM,SAASG,gBAAT,CAA0BC,M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AAsBmC,aAAa,GAAG,CAAtC,CAApB,CAArC;AACA,SAAKE,mBAAL,GAA2B1P,aAAa,CAACF,mBAAmB,CAACuP,WAAW,CAAChC,OAAb,EAAsBmC,aAAa,IAAI,IAAI,CAAR,CAAnC,CAApB,CAAxC;AACH;;AAV4B,C;;ACHjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAMG,KAAK,GAAG;AACV3G,oBADU;AAEVO,gBAFU;AAGVoE,wCAHU;AAIVpQ,0BAJU;AAKVyQ,oEALU;AAMVG,0CANU;AAOVpD,sCAPU;AAQVqE,sCARU;AASVQ,cATU;AAUVjG,8CAVU;AAWVlL,oBAXU;AAYVqC,gBAAMA;AAZI,CAAd;AAee6O,gFAAf,E","file":"Adhan.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"adhan\"] = factory();\n\telse\n\t\troot[\"adhan\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","export default class Coordinates {\n constructor(latitude, longitude) {\n this.latitude = latitude;\n this.longitude = longitude;\n }\n}\n","export function degreesToRadians(degrees) {\n return (degrees * Math.PI) / 180.0;\n}\n\nexport function radiansToDegrees(radians) {\n return (radians * 180.0) / Math.PI;\n}\n\nexport function normalizeToScale(number, max) {\n return number - (max * (Math.floor(number / max)))\n}\n\nexport function unwindAngle(angle) {\n return normalizeToScale(angle, 360.0);\n}\n\nexport function quadrantShiftAngle(angle) {\n if (angle >= -180 && angle <= 180) {\n return angle;\n }\n\n return angle - (360 * Math.round(angle/360));\n}\n","export const Rounding = {\n Nearest: 'nearest',\n Up: 'up',\n None: 'none'\n};\n","import Astronomical from './Astronomical';\nimport { Rounding } from './Rounding';\n\nexport function dateByAddingDays(date, days) {\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate() + days;\n const hours = date.getHours();\n const minutes = date.getMinutes();\n const seconds = date.getSeconds();\n return new Date(year, month, day, hours, minutes, seconds);\n}\n\nexport function dateByAddingMinutes(date, minutes) {\n return dateByAddingSeconds(date, minutes * 60);\n}\n\nexport function dateByAddingSeconds(date, seconds) {\n return new Date(date.getTime() + (seconds * 1000));\n}\n\nexport function roundedMinute(date, rounding = Rounding.Nearest) {\n const seconds = date.getUTCSeconds();\n let offset = seconds >= 30 ? 60 - seconds : -1 * seconds;\n if (rounding === Rounding.Up) {\n offset = 60 - seconds;\n } else if (rounding === Rounding.None) {\n offset = 0;\n }\n\n return dateByAddingSeconds(date, offset);\n}\n\nexport function dayOfYear(date) {\n let returnedDayOfYear = 0;\n const feb = Astronomical.isLeapYear(date.getFullYear()) ? 29 : 28;\n const months = [31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n for (let i = 0; i < date.getMonth(); i++) {\n returnedDayOfYear += months[i];\n }\n\n returnedDayOfYear += date.getDate();\n\n return returnedDayOfYear;\n}\n\nexport function isValidDate(date) {\n return date instanceof Date && !isNaN(date.valueOf());\n}\n","// Shafaq is the twilight in the sky. Different madhabs define the appearance of\n// twilight differently. These values are used by the MoonsightingComittee method\n// for the different ways to calculate Isha.\nexport const Shafaq = {\n // General is a combination of Ahmer and Abyad.\n General: 'general',\n\n // Ahmer means the twilight is the red glow in the sky. Used by the Shafi, Maliki, and Hanbali madhabs.\n Ahmer: 'ahmer',\n\n // Abyad means the twilight is the white glow in the sky. Used by the Hanafi madhab.\n Abyad: 'abyad'\n};\n","/* eslint-disable max-params, max-lines */\nimport { degreesToRadians, radiansToDegrees, unwindAngle, normalizeToScale, quadrantShiftAngle } from './MathUtils';\nimport { dateByAddingSeconds } from './DateUtils';\nimport { Shafaq } from './Shafaq';\n\nconst Astronomical = {\n\n /* The geometric mean longitude of the sun in degrees. */\n meanSolarLongitude(julianCentury) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 163 */\n const term1 = 280.4664567;\n const term2 = 36000.76983 * T;\n const term3 = 0.0003032 * Math.pow(T, 2);\n const L0 = term1 + term2 + term3;\n return unwindAngle(L0);\n },\n\n /* The geometric mean longitude of the moon in degrees. */\n meanLunarLongitude(julianCentury) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 144 */\n const term1 = 218.3165;\n const term2 = 481267.8813 * T;\n const Lp = term1 + term2;\n return unwindAngle(Lp);\n },\n\n ascendingLunarNodeLongitude(julianCentury) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 144 */\n const term1 = 125.04452;\n const term2 = 1934.136261 * T;\n const term3 = 0.0020708 * Math.pow(T, 2);\n const term4 = Math.pow(T, 3) / 450000;\n const Omega = term1 - term2 + term3 + term4;\n return unwindAngle(Omega);\n },\n\n /* The mean anomaly of the sun. */\n meanSolarAnomaly(julianCentury) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 163 */\n const term1 = 357.52911;\n const term2 = 35999.05029 * T;\n const term3 = 0.0001537 * Math.pow(T, 2);\n const M = term1 + term2 - term3;\n return unwindAngle(M);\n },\n\n /* The Sun's equation of the center in degrees. */\n solarEquationOfTheCenter(julianCentury, meanAnomaly) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 164 */\n const Mrad = degreesToRadians(meanAnomaly);\n const term1 = (1.914602 - (0.004817 * T) - (0.000014 * Math.pow(T, 2))) * Math.sin(Mrad);\n const term2 = (0.019993 - (0.000101 * T)) * Math.sin(2 * Mrad);\n const term3 = 0.000289 * Math.sin(3 * Mrad);\n return term1 + term2 + term3;\n },\n\n /* The apparent longitude of the Sun, referred to the\n true equinox of the date. */\n apparentSolarLongitude(julianCentury, meanLongitude) {\n const T = julianCentury;\n const L0 = meanLongitude;\n /* Equation from Astronomical Algorithms page 164 */\n const longitude = L0 + Astronomical.solarEquationOfTheCenter(T, Astronomical.meanSolarAnomaly(T));\n const Omega = 125.04 - (1934.136 * T);\n const Lambda = longitude - 0.00569 - (0.00478 * Math.sin(degreesToRadians(Omega)));\n return unwindAngle(Lambda);\n },\n\n /* The mean obliquity of the ecliptic, formula\n adopted by the International Astronomical Union.\n Represented in degrees. */\n meanObliquityOfTheEcliptic(julianCentury) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 147 */\n const term1 = 23.439291;\n const term2 = 0.013004167 * T;\n const term3 = 0.0000001639 * Math.pow(T, 2);\n const term4 = 0.0000005036 * Math.pow(T, 3);\n return term1 - term2 - term3 + term4;\n },\n\n /* The mean obliquity of the ecliptic, corrected for\n calculating the apparent position of the sun, in degrees. */\n apparentObliquityOfTheEcliptic(julianCentury, meanObliquityOfTheEcliptic) {\n const T = julianCentury;\n const Epsilon0 = meanObliquityOfTheEcliptic;\n /* Equation from Astronomical Algorithms page 165 */\n const O = 125.04 - (1934.136 * T);\n return Epsilon0 + (0.00256 * Math.cos(degreesToRadians(O)));\n },\n\n /* Mean sidereal time, the hour angle of the vernal equinox, in degrees. */\n meanSiderealTime(julianCentury) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 165 */\n const JD = (T * 36525) + 2451545.0;\n const term1 = 280.46061837;\n const term2 = 360.98564736629 * (JD - 2451545);\n const term3 = 0.000387933 * Math.pow(T, 2);\n const term4 = Math.pow(T, 3) / 38710000;\n const Theta = term1 + term2 + term3 - term4;\n return unwindAngle(Theta)\n },\n\n nutationInLongitude(julianCentury, solarLongitude, lunarLongitude, ascendingNode) {\n const L0 = solarLongitude;\n const Lp = lunarLongitude;\n const Omega = ascendingNode;\n /* Equation from Astronomical Algorithms page 144 */\n const term1 = (-17.2/3600) * Math.sin(degreesToRadians(Omega));\n const term2 = (1.32/3600) * Math.sin(2 * degreesToRadians(L0));\n const term3 = (0.23/3600) * Math.sin(2 * degreesToRadians(Lp));\n const term4 = (0.21/3600) * Math.sin(2 * degreesToRadians(Omega));\n return term1 - term2 - term3 + term4;\n },\n\n nutationInObliquity(julianCentury, solarLongitude, lunarLongitude, ascendingNode) {\n const L0 = solarLongitude;\n const Lp = lunarLongitude;\n const Omega = ascendingNode;\n /* Equation from Astronomical Algorithms page 144 */\n const term1 = (9.2/3600) * Math.cos(degreesToRadians(Omega));\n const term2 = (0.57/3600) * Math.cos(2 * degreesToRadians(L0));\n const term3 = (0.10/3600) * Math.cos(2 * degreesToRadians(Lp));\n const term4 = (0.09/3600) * Math.cos(2 * degreesToRadians(Omega));\n return term1 + term2 + term3 - term4;\n },\n\n altitudeOfCelestialBody(observerLatitude, declination, localHourAngle) {\n const Phi = observerLatitude;\n const delta = declination;\n const H = localHourAngle;\n /* Equation from Astronomical Algorithms page 93 */\n const term1 = Math.sin(degreesToRadians(Phi)) * Math.sin(degreesToRadians(delta));\n const term2 = Math.cos(degreesToRadians(Phi)) * Math.cos(degreesToRadians(delta)) * Math.cos(degreesToRadians(H));\n return radiansToDegrees(Math.asin(term1 + term2));\n },\n\n approximateTransit(longitude, siderealTime, rightAscension) {\n const L = longitude;\n const Theta0 = siderealTime;\n const a2 = rightAscension;\n /* Equation from page Astronomical Algorithms 102 */\n const Lw = L * -1;\n return normalizeToScale((a2 + Lw - Theta0) / 360, 1);\n },\n\n /* The time at which the sun is at its highest point in the sky (in universal time) */\n correctedTransit(approximateTransit, longitude, siderealTime, rightAscension, previousRightAscension, nextRightAscension) {\n const m0 = approximateTransit;\n const L = longitude;\n const Theta0 = siderealTime;\n const a2 = rightAscension;\n const a1 = previousRightAscension;\n const a3 = nextRightAscension;\n /* Equation from page Astronomical Algorithms 102 */\n const Lw = L * -1;\n const Theta = unwindAngle((Theta0 + (360.985647 * m0)));\n const a = unwindAngle(Astronomical.interpolateAngles(a2, a1, a3, m0));\n const H = quadrantShiftAngle(Theta - Lw - a);\n const dm = H / -360;\n return (m0 + dm) * 24;\n },\n\n correctedHourAngle(approximateTransit, angle, coordinates, afterTransit, siderealTime,\n rightAscension, previousRightAscension, nextRightAscension, declination, previousDeclination, nextDeclination) {\n const m0 = approximateTransit;\n const h0 = angle;\n const Theta0 = siderealTime;\n const a2 = rightAscension;\n const a1 = previousRightAscension;\n const a3 = nextRightAscension;\n const d2 = declination;\n const d1 = previousDeclination;\n const d3 = nextDeclination;\n\n /* Equation from page Astronomical Algorithms 102 */\n const Lw = coordinates.longitude * -1;\n const term1 = Math.sin(degreesToRadians(h0)) - (Math.sin(degreesToRadians(coordinates.latitude)) * Math.sin(degreesToRadians(d2)));\n const term2 = Math.cos(degreesToRadians(coordinates.latitude)) * Math.cos(degreesToRadians(d2));\n const H0 = radiansToDegrees(Math.acos(term1 / term2));\n const m = afterTransit ? m0 + (H0 / 360) : m0 - (H0 / 360);\n const Theta = unwindAngle((Theta0 + (360.985647 * m)));\n const a = unwindAngle(Astronomical.interpolateAngles(a2, a1, a3, m));\n const delta = Astronomical.interpolate(d2, d1, d3, m);\n const H = (Theta - Lw - a);\n const h = Astronomical.altitudeOfCelestialBody(coordinates.latitude, delta, H);\n const term3 = h - h0;\n const term4 = 360 * Math.cos(degreesToRadians(delta)) * Math.cos(degreesToRadians(coordinates.latitude)) * Math.sin(degreesToRadians(H));\n const dm = term3 / term4;\n return (m + dm) * 24;\n },\n\n /* Interpolation of a value given equidistant\n previous and next values and a factor\n equal to the fraction of the interpolated\n point's time over the time between values. */\n interpolate(y2, y1, y3, n) {\n /* Equation from Astronomical Algorithms page 24 */\n const a = y2 - y1;\n const b = y3 - y2;\n const c = b - a;\n return y2 + ((n/2) * (a + b + (n * c)));\n },\n\n /* Interpolation of three angles, accounting for\n angle unwinding. */\n interpolateAngles(y2, y1, y3, n) {\n /* Equation from Astronomical Algorithms page 24 */\n const a = unwindAngle(y2 - y1);\n const b = unwindAngle(y3 - y2);\n const c = b - a;\n return y2 + ((n/2) * (a + b + (n * c)));\n },\n\n /* The Julian Day for the given Gregorian date components. */\n julianDay(year, month, day, hours) {\n /* Equation from Astronomical Algorithms page 60 */\n if (typeof hours === 'undefined') {\n hours = 0;\n }\n\n const trunc = Math.trunc || function (x) { return x < 0 ? Math.ceil(x) : Math.floor(x); };\n\n const Y = trunc(month > 2 ? year : year - 1);\n const M = trunc(month > 2 ? month : month + 12);\n const D = day + (hours / 24);\n\n const A = trunc(Y/100);\n const B = trunc(2 - A + trunc(A/4));\n\n const i0 = trunc(365.25 * (Y + 4716));\n const i1 = trunc(30.6001 * (M + 1));\n\n return i0 + i1 + D + B - 1524.5;\n },\n\n /* Julian century from the epoch. */\n julianCentury(julianDay) {\n /* Equation from Astronomical Algorithms page 163 */\n return (julianDay - 2451545.0) / 36525;\n },\n\n /* Whether or not a year is a leap year (has 366 days). */\n isLeapYear(year) {\n if (year % 4 !== 0) {\n return false;\n }\n\n if (year % 100 === 0 && year % 400 !== 0) {\n return false;\n }\n\n return true;\n },\n\n seasonAdjustedMorningTwilight(latitude, dayOfYear, year, sunrise) {\n const a = 75 + ((28.65 / 55.0) * Math.abs(latitude));\n const b = 75 + ((19.44 / 55.0) * Math.abs(latitude));\n const c = 75 + ((32.74 / 55.0) * Math.abs(latitude));\n const d = 75 + ((48.10 / 55.0) * Math.abs(latitude));\n\n const adjustment = (function() {\n const dyy = Astronomical.daysSinceSolstice(dayOfYear, year, latitude);\n if ( dyy < 91) {\n return a + ( b - a ) / 91.0 * dyy;\n } else if ( dyy < 137) {\n return b + ( c - b ) / 46.0 * ( dyy - 91 );\n } else if ( dyy < 183 ) {\n return c + ( d - c ) / 46.0 * ( dyy - 137 );\n } else if ( dyy < 229 ) {\n return d + ( c - d ) / 46.0 * ( dyy - 183 );\n } else if ( dyy < 275 ) {\n return c + ( b - c ) / 46.0 * ( dyy - 229 );\n } else {\n return b + ( a - b ) / 91.0 * ( dyy - 275 );\n }\n })();\n\n return dateByAddingSeconds(sunrise, Math.round(adjustment * -60.0));\n },\n\n seasonAdjustedEveningTwilight(latitude, dayOfYear, year, sunset, shafaq) {\n let a, b, c, d;\n if (shafaq === Shafaq.Ahmer) {\n a = 62 + ((17.40 / 55.0) * Math.abs(latitude));\n b = 62 - ((7.160 / 55.0) * Math.abs(latitude));\n c = 62 + ((5.120 / 55.0) * Math.abs(latitude));\n d = 62 + ((19.44 / 55.0) * Math.abs(latitude));\n } else if (shafaq === Shafaq.Abyad) {\n a = 75 + ((25.60 / 55.0) * Math.abs(latitude));\n b = 75 + ((7.160 / 55.0) * Math.abs(latitude));\n c = 75 + ((36.84 / 55.0) * Math.abs(latitude));\n d = 75 + ((81.84 / 55.0) * Math.abs(latitude));\n } else {\n a = 75 + ((25.60 / 55.0) * Math.abs(latitude));\n b = 75 + ((2.050 / 55.0) * Math.abs(latitude));\n c = 75 - ((9.210 / 55.0) * Math.abs(latitude));\n d = 75 + ((6.140 / 55.0) * Math.abs(latitude));\n }\n\n const adjustment = (function() {\n const dyy = Astronomical.daysSinceSolstice(dayOfYear, year, latitude);\n if ( dyy < 91) {\n return a + ( b - a ) / 91.0 * dyy;\n } else if ( dyy < 137) {\n return b + ( c - b ) / 46.0 * ( dyy - 91 );\n } else if ( dyy < 183 ) {\n return c + ( d - c ) / 46.0 * ( dyy - 137 );\n } else if ( dyy < 229 ) {\n return d + ( c - d ) / 46.0 * ( dyy - 183 );\n } else if ( dyy < 275 ) {\n return c + ( b - c ) / 46.0 * ( dyy - 229 );\n } else {\n return b + ( a - b ) / 91.0 * ( dyy - 275 );\n }\n })();\n\n return dateByAddingSeconds(sunset, Math.round(adjustment * 60.0));\n },\n\n daysSinceSolstice(dayOfYear, year, latitude) {\n let daysSinceSolstice = 0;\n const northernOffset = 10;\n const southernOffset = Astronomical.isLeapYear(year) ? 173 : 172;\n const daysInYear = Astronomical.isLeapYear(year) ? 366 : 365;\n\n if (latitude >= 0) {\n daysSinceSolstice = dayOfYear + northernOffset;\n if (daysSinceSolstice >= daysInYear) {\n daysSinceSolstice = daysSinceSolstice - daysInYear;\n }\n } else {\n daysSinceSolstice = dayOfYear - southernOffset;\n if (daysSinceSolstice < 0) {\n daysSinceSolstice = daysSinceSolstice + daysInYear;\n }\n }\n\n return daysSinceSolstice;\n }\n};\n\nexport default Astronomical;","import Astronomical from './Astronomical';\nimport { degreesToRadians, radiansToDegrees, unwindAngle } from './MathUtils';\n\nexport default class SolarCoordinates {\n constructor(julianDay) {\n const T = Astronomical.julianCentury(julianDay);\n const L0 = Astronomical.meanSolarLongitude(T);\n const Lp = Astronomical.meanLunarLongitude(T);\n const Omega = Astronomical.ascendingLunarNodeLongitude(T);\n const Lambda = degreesToRadians(Astronomical.apparentSolarLongitude(T, L0));\n const Theta0 = Astronomical.meanSiderealTime(T);\n const dPsi = Astronomical.nutationInLongitude(T, L0, Lp, Omega);\n const dEpsilon = Astronomical.nutationInObliquity(T, L0, Lp, Omega);\n const Epsilon0 = Astronomical.meanObliquityOfTheEcliptic(T);\n const EpsilonApparent = degreesToRadians(Astronomical.apparentObliquityOfTheEcliptic(T, Epsilon0));\n\n /* declination: The declination of the sun, the angle between\n the rays of the Sun and the plane of the Earth's\n equator, in degrees.\n Equation from Astronomical Algorithms page 165 */\n this.declination = radiansToDegrees(Math.asin(Math.sin(EpsilonApparent) * Math.sin(Lambda)));\n\n /* rightAscension: Right ascension of the Sun, the angular distance on the\n celestial equator from the vernal equinox to the hour circle,\n in degrees.\n Equation from Astronomical Algorithms page 165 */\n this.rightAscension = unwindAngle(radiansToDegrees(Math.atan2(Math.cos(EpsilonApparent) * Math.sin(Lambda), Math.cos(Lambda))));\n\n /* apparentSiderealTime: Apparent sidereal time, the hour angle of the vernal\n equinox, in degrees.\n Equation from Astronomical Algorithms page 88 */\n this.apparentSiderealTime = Theta0 + (((dPsi * 3600) * Math.cos(degreesToRadians(Epsilon0 + dEpsilon))) / 3600);\n }\n}\n\n","import Astronomical from './Astronomical';\nimport { degreesToRadians, radiansToDegrees } from './MathUtils'\nimport SolarCoordinates from './SolarCoordinates';\n\nexport default class SolarTime {\n constructor(date, coordinates) {\n const julianDay = Astronomical.julianDay(date.getFullYear(), date.getMonth() + 1, date.getDate(), 0);\n\n this.observer = coordinates;\n this.solar = new SolarCoordinates(julianDay);\n\n this.prevSolar = new SolarCoordinates(julianDay - 1);\n this.nextSolar = new SolarCoordinates(julianDay + 1);\n\n const m0 = Astronomical.approximateTransit(coordinates.longitude, this.solar.apparentSiderealTime, this.solar.rightAscension);\n const solarAltitude = -50.0 / 60.0;\n\n this.approxTransit = m0;\n\n this.transit = Astronomical.correctedTransit(m0, coordinates.longitude, this.solar.apparentSiderealTime, \n this.solar.rightAscension, this.prevSolar.rightAscension, this.nextSolar.rightAscension);\n\n this.sunrise = Astronomical.correctedHourAngle(m0, solarAltitude, coordinates, false, this.solar.apparentSiderealTime, \n this.solar.rightAscension, this.prevSolar.rightAscension, this.nextSolar.rightAscension, \n this.solar.declination, this.prevSolar.declination, this.nextSolar.declination);\n\n this.sunset = Astronomical.correctedHourAngle(m0, solarAltitude, coordinates, true, this.solar.apparentSiderealTime, \n this.solar.rightAscension, this.prevSolar.rightAscension, this.nextSolar.rightAscension, \n this.solar.declination, this.prevSolar.declination, this.nextSolar.declination);\n }\n\n hourAngle(angle, afterTransit) {\n return Astronomical.correctedHourAngle(this.approxTransit, angle, this.observer, afterTransit, this.solar.apparentSiderealTime, \n this.solar.rightAscension, this.prevSolar.rightAscension, this.nextSolar.rightAscension, \n this.solar.declination, this.prevSolar.declination, this.nextSolar.declination);\n }\n\n afternoon(shadowLength) {\n // TODO source shadow angle calculation\n const tangent = Math.abs(this.observer.latitude - this.solar.declination);\n const inverse = shadowLength + Math.tan(degreesToRadians(tangent));\n const angle = radiansToDegrees(Math.atan(1.0 / inverse));\n return this.hourAngle(angle, true);\n }\n}\n\n\n","export default class TimeComponents {\n constructor(number) {\n this.hours = Math.floor(number);\n this.minutes = Math.floor((number - this.hours) * 60);\n this.seconds = Math.floor((number - (this.hours + this.minutes / 60)) * 60 * 60);\n return this;\n }\n \n utcDate(year, month, date) {\n return new Date(Date.UTC(year, month, date, this.hours, this.minutes, this.seconds));\n }\n}\n","const Prayer = {\n Fajr: 'fajr',\n Sunrise: 'sunrise',\n Dhuhr: 'dhuhr',\n Asr: 'asr',\n Maghrib: 'maghrib',\n Isha: 'isha',\n None: 'none'\n};\n\nexport default Prayer;","export const Madhab = {\n Shafi: 'shafi',\n Hanafi: 'hanafi'\n};\n\nexport function shadowLength(madhab) {\n switch (madhab) {\n case Madhab.Shafi:\n return 1;\n case Madhab.Hanafi:\n return 2\n default:\n throw \"Invalid Madhab\";\n }\n}\n","import SolarTime from './SolarTime';\nimport { dateByAddingDays } from './DateUtils';\n\nexport const PolarCircleResolution = {\n AqrabBalad: 'AqrabBalad',\n AqrabYaum: 'AqrabYaum',\n Unresolved: 'Unresolved'\n};\n\nconst LATITUDE_VARIATION_STEP = 0.5; // Degrees to add/remove at each resolution step\nconst UNSAFE_LATITUDE = 65; // Based on https://en.wikipedia.org/wiki/Midnight_sun\n\nconst isValidSolarTime = (solarTime) => solarTime && !isNaN(solarTime.sunrise) && !isNaN(solarTime.sunset);\n\nconst aqrabYaumResolver = (coordinates, date, daysAdded = 1, direction = 1) => {\n if (daysAdded > Math.ceil(365 / 2)) {\n return null;\n }\n const testDate = new Date(date.getTime());\n testDate.setDate(testDate.getDate() + (direction * daysAdded));\n const tomorrow = dateByAddingDays(testDate, 1);\n const solarTime = new SolarTime(testDate, coordinates);\n const tomorrowSolarTime = new SolarTime(tomorrow, coordinates);\n\n if (!isValidSolarTime(solarTime) || !isValidSolarTime(tomorrowSolarTime)) {\n return aqrabYaumResolver(coordinates, date, daysAdded + (direction > 0 ? 0 : 1), -direction);\n }\n\n return {\n date,\n tomorrow,\n coordinates,\n solarTime,\n tomorrowSolarTime,\n };\n}\n\nconst aqrabBaladResolver = (coordinates, date, latitude) => {\n const solarTime = new SolarTime(date, { ...coordinates, latitude });\n const tomorrow = dateByAddingDays(date, 1);\n const tomorrowSolarTime = new SolarTime(tomorrow, { ...coordinates, latitude });\n if (!isValidSolarTime(solarTime) || !isValidSolarTime(tomorrowSolarTime)) {\n return (Math.abs(latitude) >= UNSAFE_LATITUDE) ?\n aqrabBaladResolver(coordinates, date, latitude - Math.sign(latitude) * LATITUDE_VARIATION_STEP)\n : null;\n }\n\n return {\n date,\n tomorrow,\n coordinates: { latitude, longitude: coordinates.longitude },\n solarTime,\n tomorrowSolarTime,\n };\n};\n\nexport const polarCircleResolvedValues = (resolver, date, coordinates) => {\n const defaultReturn = {\n date,\n tomorrow: dateByAddingDays(date, 1),\n coordinates,\n solarTime: new SolarTime(date, coordinates),\n tomorrowSolarTime: new SolarTime(dateByAddingDays(date, 1), coordinates),\n };\n\n switch (resolver) {\n case PolarCircleResolution.AqrabYaum: {\n return aqrabYaumResolver(coordinates, date) || defaultReturn;\n }\n case PolarCircleResolution.AqrabBalad: {\n const { latitude } = coordinates;\n return aqrabBaladResolver(coordinates, date, latitude - (Math.sign(latitude) * LATITUDE_VARIATION_STEP)) || defaultReturn;\n }\n default: {\n return defaultReturn;\n }\n }\n};\n","import SolarTime from './SolarTime';\nimport TimeComponents from './TimeComponents';\nimport Prayer from './Prayer';\nimport Astronomical from './Astronomical';\nimport {\n dateByAddingDays,\n dateByAddingMinutes,\n dateByAddingSeconds,\n roundedMinute,\n dayOfYear,\n isValidDate\n} from './DateUtils';\nimport { shadowLength } from './Madhab';\nimport { PolarCircleResolution, polarCircleResolvedValues } from './PolarCircleResolution';\n\nexport default class PrayerTimes {\n // eslint-disable-next-line complexity\n constructor(coordinates, date, calculationParameters) {\n this.coordinates = coordinates;\n this.date = date;\n this.calculationParameters = calculationParameters;\n\n let solarTime = new SolarTime(date, coordinates);\n\n let fajrTime;\n let sunriseTime;\n let dhuhrTime;\n let asrTime;\n let maghribTime;\n let ishaTime;\n\n let nightFraction;\n\n dhuhrTime = new TimeComponents(solarTime.transit).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n sunriseTime = new TimeComponents(solarTime.sunrise).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n let sunsetTime = new TimeComponents(solarTime.sunset).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n let tomorrow = dateByAddingDays(date, 1);\n let tomorrowSolarTime = new SolarTime(tomorrow, coordinates);\n\n const polarCircleResolver = calculationParameters.polarCircleResolution;\n if (\n (!isValidDate(sunriseTime) || !isValidDate(sunsetTime) || isNaN(tomorrowSolarTime.sunrise))\n && polarCircleResolver !== PolarCircleResolution.Unresolved\n ) {\n const resolved = polarCircleResolvedValues(polarCircleResolver, date, coordinates);\n this.coordinates = resolved.coordinates;\n this.date.setTime(resolved.date.getTime());\n solarTime = resolved.solarTime;\n tomorrow = resolved.tomorrow;\n tomorrowSolarTime = resolved.tomorrowSolarTime;\n const dateComponents = [date.getFullYear(), date.getMonth(), date.getDate()];\n\n dhuhrTime = new TimeComponents(solarTime.transit).utcDate(...dateComponents);\n sunriseTime = new TimeComponents(solarTime.sunrise).utcDate(...dateComponents);\n sunsetTime = new TimeComponents(solarTime.sunset).utcDate(...dateComponents);\n }\n\n // eslint-disable-next-line prefer-const\n asrTime = new TimeComponents(solarTime.afternoon(shadowLength(calculationParameters.madhab))).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n\n const tomorrowSunrise = new TimeComponents(tomorrowSolarTime.sunrise).utcDate(tomorrow.getFullYear(), tomorrow.getMonth(), tomorrow.getDate());\n const night = (tomorrowSunrise - sunsetTime) / 1000;\n\n fajrTime = new TimeComponents(solarTime.hourAngle(-1 * calculationParameters.fajrAngle, false)).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n\n // special case for moonsighting committee above latitude 55\n if (calculationParameters.method === \"MoonsightingCommittee\" && coordinates.latitude >= 55) {\n nightFraction = night / 7;\n fajrTime = dateByAddingSeconds(sunriseTime, -nightFraction);\n }\n\n const safeFajr = (function () {\n if (calculationParameters.method === \"MoonsightingCommittee\") {\n return Astronomical.seasonAdjustedMorningTwilight(coordinates.latitude, dayOfYear(date), date.getFullYear(), sunriseTime);\n }\n else {\n const portion = calculationParameters.nightPortions().fajr;\n nightFraction = portion * night;\n return dateByAddingSeconds(sunriseTime, -nightFraction);\n }\n })();\n\n if (fajrTime === null || isNaN(fajrTime.getTime()) || safeFajr > fajrTime) {\n fajrTime = safeFajr;\n }\n\n if (calculationParameters.ishaInterval > 0) {\n ishaTime = dateByAddingMinutes(sunsetTime, calculationParameters.ishaInterval);\n } else {\n ishaTime = new TimeComponents(solarTime.hourAngle(-1 * calculationParameters.ishaAngle, true)).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n\n // special case for moonsighting committee above latitude 55\n if (calculationParameters.method === \"MoonsightingCommittee\" && coordinates.latitude >= 55) {\n nightFraction = night / 7;\n ishaTime = dateByAddingSeconds(sunsetTime, nightFraction);\n }\n\n const safeIsha = (function () {\n if (calculationParameters.method === \"MoonsightingCommittee\") {\n return Astronomical.seasonAdjustedEveningTwilight(coordinates.latitude, dayOfYear(date), date.getFullYear(), sunsetTime, calculationParameters.shafaq);\n }\n else {\n const portion = calculationParameters.nightPortions().isha;\n nightFraction = portion * night;\n return dateByAddingSeconds(sunsetTime, nightFraction);\n }\n })();\n\n if (ishaTime == null || isNaN(ishaTime.getTime()) || safeIsha < ishaTime) {\n ishaTime = safeIsha;\n }\n }\n\n maghribTime = sunsetTime;\n if (calculationParameters.maghribAngle) {\n const angleBasedMaghrib = new TimeComponents(solarTime.hourAngle(-1 * calculationParameters.maghribAngle, true)).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n if (sunsetTime < angleBasedMaghrib && ishaTime > angleBasedMaghrib) {\n maghribTime = angleBasedMaghrib;\n }\n }\n\n const fajrAdjustment = (calculationParameters.adjustments.fajr || 0) + (calculationParameters.methodAdjustments.fajr || 0);\n const sunriseAdjustment = (calculationParameters.adjustments.sunrise || 0) + (calculationParameters.methodAdjustments.sunrise || 0);\n const dhuhrAdjustment = (calculationParameters.adjustments.dhuhr || 0) + (calculationParameters.methodAdjustments.dhuhr || 0);\n const asrAdjustment = (calculationParameters.adjustments.asr || 0) + (calculationParameters.methodAdjustments.asr || 0);\n const maghribAdjustment = (calculationParameters.adjustments.maghrib || 0) + (calculationParameters.methodAdjustments.maghrib || 0);\n const ishaAdjustment = (calculationParameters.adjustments.isha || 0) + (calculationParameters.methodAdjustments.isha || 0);\n\n this.fajr = roundedMinute(dateByAddingMinutes(fajrTime, fajrAdjustment), calculationParameters.rounding);\n this.sunrise = roundedMinute(dateByAddingMinutes(sunriseTime, sunriseAdjustment), calculationParameters.rounding);\n this.dhuhr = roundedMinute(dateByAddingMinutes(dhuhrTime, dhuhrAdjustment), calculationParameters.rounding);\n this.asr = roundedMinute(dateByAddingMinutes(asrTime, asrAdjustment), calculationParameters.rounding);\n this.maghrib = roundedMinute(dateByAddingMinutes(maghribTime, maghribAdjustment), calculationParameters.rounding);\n this.isha = roundedMinute(dateByAddingMinutes(ishaTime, ishaAdjustment), calculationParameters.rounding);\n }\n\n timeForPrayer(prayer) {\n if (prayer === Prayer.Fajr) {\n return this.fajr;\n }\n else if (prayer === Prayer.Sunrise) {\n return this.sunrise;\n }\n else if (prayer === Prayer.Dhuhr) {\n return this.dhuhr;\n }\n else if (prayer === Prayer.Asr) {\n return this.asr;\n }\n else if (prayer === Prayer.Maghrib) {\n return this.maghrib;\n }\n else if (prayer === Prayer.Isha) {\n return this.isha;\n }\n else {\n return null;\n }\n }\n\n currentPrayer(date) {\n if (typeof date === 'undefined') {\n date = new Date();\n }\n if (date >= this.isha) {\n return Prayer.Isha;\n }\n else if (date >= this.maghrib) {\n return Prayer.Maghrib;\n }\n else if (date >= this.asr) {\n return Prayer.Asr;\n }\n else if (date >= this.dhuhr) {\n return Prayer.Dhuhr;\n }\n else if (date >= this.sunrise) {\n return Prayer.Sunrise;\n }\n else if (date >= this.fajr) {\n return Prayer.Fajr;\n }\n else {\n return Prayer.None;\n }\n }\n\n nextPrayer(date) {\n if (typeof date === 'undefined') {\n date = new Date();\n }\n if (date >= this.isha) {\n return Prayer.None;\n }\n else if (date >= this.maghrib) {\n return Prayer.Isha;\n }\n else if (date >= this.asr) {\n return Prayer.Maghrib;\n }\n else if (date >= this.dhuhr) {\n return Prayer.Asr;\n }\n else if (date >= this.sunrise) {\n return Prayer.Dhuhr;\n }\n else if (date >= this.fajr) {\n return Prayer.Sunrise;\n }\n else {\n return Prayer.Fajr;\n }\n }\n}\n\n","const HighLatitudeRule = {\n MiddleOfTheNight: 'middleofthenight',\n SeventhOfTheNight: 'seventhofthenight',\n TwilightAngle: 'twilightangle',\n\n recommended(coordinates) {\n if (coordinates.latitude > 48) {\n return HighLatitudeRule.SeventhOfTheNight;\n } else {\n return HighLatitudeRule.MiddleOfTheNight;\n }\n }\n};\n\nexport default HighLatitudeRule;","import { Madhab } from './Madhab';\nimport HighLatitudeRule from './HighLatitudeRule';\nimport { PolarCircleResolution } from './PolarCircleResolution';\nimport { Rounding } from './Rounding';\nimport { Shafaq } from './Shafaq';\n\nexport default class CalculationParameters {\n constructor(methodName, fajrAngle, ishaAngle, ishaInterval, maghribAngle) {\n // Name of the method, can be used to apply special behavior in calculations.\n // This property should not be manually modified.\n this.method = methodName || \"Other\";\n\n // Angle of the sun below the horizon used for calculating Fajr.\n this.fajrAngle = fajrAngle || 0;\n\n // Angle of the sun below the horizon used for calculating Isha.\n this.ishaAngle = ishaAngle || 0;\n\n // Minutes after Maghrib to determine time for Isha\n // if this value is greater than 0 then ishaAngle is not used.\n this.ishaInterval = ishaInterval || 0;\n\n // Angle of the sun below the horizon used for calculating Maghrib.\n // Only used by the Tehran method to account for lightness in the sky.\n this.maghribAngle = maghribAngle;\n\n // Madhab to determine how Asr is calculated.\n this.madhab = Madhab.Shafi;\n\n // Rule to determine the earliest time for Fajr and latest time for Isha\n // needed for high latitude locations where Fajr and Isha may not truly exist\n // or may present a hardship unless bound to a reasonable time.\n this.highLatitudeRule = HighLatitudeRule.MiddleOfTheNight;\n\n // Manual adjustments (in minutes) to be added to each prayer time.\n this.adjustments = { fajr: 0, sunrise: 0, dhuhr: 0, asr: 0, maghrib: 0, isha: 0 };\n\n // Adjustments set by a calculation method. This value should not be manually modified.\n this.methodAdjustments = { fajr: 0, sunrise: 0, dhuhr: 0, asr: 0, maghrib: 0, isha: 0 };\n\n // Rule to determine how to resolve prayer times inside the Polar Circle\n // where daylight or night may persist for more than 24 hours depending\n // on the season\n this.polarCircleResolution = PolarCircleResolution.Unresolved;\n\n // How seconds are rounded when calculating prayer times\n this.rounding = Rounding.Nearest;\n\n // Used by the MoonsightingCommittee method to determine how to calculate Isha\n this.shafaq = Shafaq.General;\n }\n\n nightPortions() {\n switch (this.highLatitudeRule) {\n case HighLatitudeRule.MiddleOfTheNight:\n return { fajr: 1 / 2, isha: 1 / 2 };\n case HighLatitudeRule.SeventhOfTheNight:\n return { fajr: 1 / 7, isha: 1 / 7 };\n case HighLatitudeRule.TwilightAngle:\n return { fajr: this.fajrAngle / 60, isha: this.ishaAngle / 60 };\n default:\n throw(`Invalid high latitude rule found when attempting to compute night portions: ${this.highLatitudeRule}`);\n }\n }\n}\n","import CalculationParameters from './CalculationParameters';\nimport { Rounding } from './Rounding';\n\nconst CalculationMethod = {\n // Muslim World League\n MuslimWorldLeague() {\n const params = new CalculationParameters(\"MuslimWorldLeague\", 18, 17);\n params.methodAdjustments = { dhuhr: 1 };\n return params;\n },\n\n // Egyptian General Authority of Survey\n Egyptian() {\n const params = new CalculationParameters(\"Egyptian\", 19.5, 17.5);\n params.methodAdjustments = { dhuhr: 1 };\n return params;\n },\n\n // University of Islamic Sciences, Karachi\n Karachi() {\n const params = new CalculationParameters(\"Karachi\", 18, 18);\n params.methodAdjustments = { dhuhr: 1 };\n return params;\n },\n\n // Umm al-Qura University, Makkah\n UmmAlQura() {\n return new CalculationParameters(\"UmmAlQura\", 18.5, 0, 90);\n },\n\n // Dubai\n Dubai() {\n const params = new CalculationParameters(\"Dubai\", 18.2, 18.2);\n params.methodAdjustments = { sunrise: -3, dhuhr: 3, asr: 3, maghrib: 3 };\n return params;\n },\n\n // Moonsighting Committee\n MoonsightingCommittee() {\n const params = new CalculationParameters(\"MoonsightingCommittee\", 18, 18);\n params.methodAdjustments = { dhuhr: 5, maghrib: 3 };\n return params;\n },\n\n // ISNA\n NorthAmerica() {\n const params = new CalculationParameters(\"NorthAmerica\", 15, 15);\n params.methodAdjustments = { dhuhr: 1 };\n return params;\n },\n\n // Kuwait\n Kuwait() {\n return new CalculationParameters(\"Kuwait\", 18, 17.5);\n },\n\n // Qatar\n Qatar() {\n return new CalculationParameters(\"Qatar\", 18, 0, 90);\n },\n\n // Singapore\n Singapore() {\n const params = new CalculationParameters(\"Singapore\", 20, 18);\n params.methodAdjustments = { dhuhr: 1 };\n params.rounding = Rounding.Up;\n return params;\n },\n\n // Institute of Geophysics, University of Tehran\n Tehran() {\n const params = new CalculationParameters(\"Tehran\", 17.7, 14, 0, 4.5);\n return params;\n },\n\n // Dianet\n Turkey() {\n const params = new CalculationParameters(\"Turkey\", 18, 17);\n params.methodAdjustments = { sunrise: -7, dhuhr: 5, asr: 4, maghrib: 7 };\n return params;\n },\n\n // Other\n Other() {\n return new CalculationParameters(\"Other\", 0, 0);\n }\n};\n\nexport default CalculationMethod;","import Coordinates from './Coordinates'\nimport { degreesToRadians, radiansToDegrees, unwindAngle } from './MathUtils'\n\nexport default function qibla(coordinates) {\n const makkah = new Coordinates(21.4225241, 39.8261818);\n\n // Equation from \"Spherical Trigonometry For the use of colleges and schools\" page 50\n const term1 = (\n Math.sin(degreesToRadians(makkah.longitude) -\n degreesToRadians(coordinates.longitude))\n );\n const term2 = (\n Math.cos(degreesToRadians(coordinates.latitude)) *\n Math.tan(degreesToRadians(makkah.latitude))\n );\n const term3 = (\n Math.sin(degreesToRadians(coordinates.latitude)) *\n Math.cos(degreesToRadians(makkah.longitude) -\n degreesToRadians(coordinates.longitude))\n );\n const angle = Math.atan2(term1, term2 - term3);\n\n return unwindAngle(radiansToDegrees(angle));\n}\n","import { dateByAddingDays, dateByAddingSeconds, roundedMinute } from './DateUtils';\nimport PrayerTimes from './PrayerTimes';\n\nexport default class SunnahTimes {\n constructor(prayerTimes) {\n const date = prayerTimes.date;\n const nextDay = dateByAddingDays(date, 1);\n const nextDayPrayerTimes = new PrayerTimes(prayerTimes.coordinates, nextDay, prayerTimes.calculationParameters);\n\n const nightDuration = (nextDayPrayerTimes.fajr.getTime() - prayerTimes.maghrib.getTime()) / 1000.0;\n\n this.middleOfTheNight = roundedMinute(dateByAddingSeconds(prayerTimes.maghrib, nightDuration / 2));\n this.lastThirdOfTheNight = roundedMinute(dateByAddingSeconds(prayerTimes.maghrib, nightDuration * (2 / 3)));\n }\n}\n\n","import Coordinates from './Coordinates';\nimport PrayerTimes from './PrayerTimes';\nimport Prayer from './Prayer';\nimport { Madhab } from './Madhab';\nimport HighLatitudeRule from './HighLatitudeRule';\nimport CalculationMethod from './CalculationMethod';\nimport CalculationParameters from './CalculationParameters';\nimport Qibla from './Qibla';\nimport SunnahTimes from './SunnahTimes';\nimport { PolarCircleResolution } from './PolarCircleResolution';\nimport { Rounding } from './Rounding';\nimport { Shafaq } from './Shafaq';\n\nconst adhan = {\n Prayer,\n Madhab,\n HighLatitudeRule,\n Coordinates,\n CalculationParameters,\n CalculationMethod,\n PrayerTimes,\n SunnahTimes,\n Qibla,\n PolarCircleResolution,\n Rounding,\n Shafaq\n};\n\nexport default adhan;"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://adhan/webpack/universalModuleDefinition","webpack://adhan/webpack/bootstrap","webpack://adhan/./src/Coordinates.js","webpack://adhan/./src/MathUtils.js","webpack://adhan/./src/Rounding.js","webpack://adhan/./src/DateUtils.js","webpack://adhan/./src/Shafaq.js","webpack://adhan/./src/Astronomical.js","webpack://adhan/./src/SolarCoordinates.js","webpack://adhan/./src/SolarTime.js","webpack://adhan/./src/TimeComponents.js","webpack://adhan/./src/Prayer.js","webpack://adhan/./src/Madhab.js","webpack://adhan/./src/PolarCircleResolution.js","webpack://adhan/./src/PrayerTimes.js","webpack://adhan/./src/HighLatitudeRule.js","webpack://adhan/./src/CalculationParameters.js","webpack://adhan/./src/CalculationMethod.js","webpack://adhan/./src/Qibla.js","webpack://adhan/./src/SunnahTimes.js","webpack://adhan/./src/Adhan.js"],"names":["Coordinates","constructor","latitude","longitude","degreesToRadians","degrees","Math","PI","radiansToDegrees","radians","normalizeToScale","number","max","floor","unwindAngle","angle","quadrantShiftAngle","round","Rounding","Nearest","Up","None","dateByAddingDays","date","days","year","getFullYear","month","getMonth","day","getDate","hours","getHours","minutes","getMinutes","seconds","getSeconds","Date","dateByAddingMinutes","dateByAddingSeconds","getTime","roundedMinute","rounding","getUTCSeconds","offset","dayOfYear","returnedDayOfYear","feb","Astronomical","isLeapYear","months","i","isValidDate","isNaN","valueOf","Shafaq","General","Ahmer","Abyad","meanSolarLongitude","julianCentury","T","term1","term2","term3","pow","L0","meanLunarLongitude","Lp","ascendingLunarNodeLongitude","term4","Omega","meanSolarAnomaly","M","solarEquationOfTheCenter","meanAnomaly","Mrad","sin","apparentSolarLongitude","meanLongitude","Lambda","meanObliquityOfTheEcliptic","apparentObliquityOfTheEcliptic","Epsilon0","O","cos","meanSiderealTime","JD","Theta","nutationInLongitude","solarLongitude","lunarLongitude","ascendingNode","nutationInObliquity","altitudeOfCelestialBody","observerLatitude","declination","localHourAngle","Phi","delta","H","asin","approximateTransit","siderealTime","rightAscension","L","Theta0","a2","Lw","correctedTransit","previousRightAscension","nextRightAscension","m0","a1","a3","a","interpolateAngles","dm","correctedHourAngle","coordinates","afterTransit","previousDeclination","nextDeclination","h0","d2","d1","d3","H0","acos","m","interpolate","h","y2","y1","y3","n","b","c","julianDay","trunc","x","ceil","Y","D","A","B","i0","i1","seasonAdjustedMorningTwilight","sunrise","abs","d","adjustment","dyy","daysSinceSolstice","seasonAdjustedEveningTwilight","sunset","shafaq","northernOffset","southernOffset","daysInYear","SolarCoordinates","dPsi","dEpsilon","EpsilonApparent","atan2","apparentSiderealTime","SolarTime","observer","solar","prevSolar","nextSolar","solarAltitude","approxTransit","transit","hourAngle","afternoon","shadowLength","tangent","inverse","tan","atan","TimeComponents","utcDate","UTC","Prayer","Fajr","Sunrise","Dhuhr","Asr","Maghrib","Isha","Madhab","Shafi","Hanafi","madhab","PolarCircleResolution","AqrabBalad","AqrabYaum","Unresolved","LATITUDE_VARIATION_STEP","UNSAFE_LATITUDE","isValidSolarTime","solarTime","aqrabYaumResolver","daysAdded","direction","testDate","setDate","tomorrow","tomorrowSolarTime","aqrabBaladResolver","sign","polarCircleResolvedValues","resolver","defaultReturn","PrayerTimes","calculationParameters","fajrTime","sunriseTime","dhuhrTime","asrTime","maghribTime","ishaTime","nightFraction","sunsetTime","polarCircleResolver","polarCircleResolution","resolved","dateComponents","tomorrowSunrise","night","fajrAngle","method","safeFajr","portion","nightPortions","fajr","ishaInterval","ishaAngle","safeIsha","isha","maghribAngle","angleBasedMaghrib","fajrAdjustment","adjustments","methodAdjustments","sunriseAdjustment","dhuhrAdjustment","dhuhr","asrAdjustment","asr","maghribAdjustment","maghrib","ishaAdjustment","timeForPrayer","prayer","currentPrayer","nextPrayer","HighLatitudeRule","MiddleOfTheNight","SeventhOfTheNight","TwilightAngle","recommended","CalculationParameters","methodName","highLatitudeRule","CalculationMethod","MuslimWorldLeague","params","Egyptian","Karachi","UmmAlQura","Dubai","MoonsightingCommittee","NorthAmerica","Kuwait","Qatar","Singapore","Tehran","Turkey","Other","qibla","makkah","SunnahTimes","prayerTimes","nextDay","nextDayPrayerTimes","nightDuration","middleOfTheNight","lastThirdOfTheNight","adhan","Qibla"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QAC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":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"adhan\"] = factory();\n\telse\n\t\troot[\"adhan\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","export default class Coordinates {\n constructor(latitude, longitude) {\n this.latitude = latitude;\n this.longitude = longitude;\n }\n}\n","export function degreesToRadians(degrees) {\n return (degrees * Math.PI) / 180.0;\n}\n\nexport function radiansToDegrees(radians) {\n return (radians * 180.0) / Math.PI;\n}\n\nexport function normalizeToScale(number, max) {\n return number - (max * (Math.floor(number / max)))\n}\n\nexport function unwindAngle(angle) {\n return normalizeToScale(angle, 360.0);\n}\n\nexport function quadrantShiftAngle(angle) {\n if (angle >= -180 && angle <= 180) {\n return angle;\n }\n\n return angle - (360 * Math.round(angle/360));\n}\n","export const Rounding = {\n Nearest: 'nearest',\n Up: 'up',\n None: 'none'\n};\n","import Astronomical from './Astronomical';\nimport { Rounding } from './Rounding';\n\nexport function dateByAddingDays(date, days) {\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate() + days;\n const hours = date.getHours();\n const minutes = date.getMinutes();\n const seconds = date.getSeconds();\n return new Date(year, month, day, hours, minutes, seconds);\n}\n\nexport function dateByAddingMinutes(date, minutes) {\n return dateByAddingSeconds(date, minutes * 60);\n}\n\nexport function dateByAddingSeconds(date, seconds) {\n return new Date(date.getTime() + (seconds * 1000));\n}\n\nexport function roundedMinute(date, rounding = Rounding.Nearest) {\n const seconds = date.getUTCSeconds();\n let offset = seconds >= 30 ? 60 - seconds : -1 * seconds;\n if (rounding === Rounding.Up) {\n offset = 60 - seconds;\n } else if (rounding === Rounding.None) {\n offset = 0;\n }\n\n return dateByAddingSeconds(date, offset);\n}\n\nexport function dayOfYear(date) {\n let returnedDayOfYear = 0;\n const feb = Astronomical.isLeapYear(date.getFullYear()) ? 29 : 28;\n const months = [31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n for (let i = 0; i < date.getMonth(); i++) {\n returnedDayOfYear += months[i];\n }\n\n returnedDayOfYear += date.getDate();\n\n return returnedDayOfYear;\n}\n\nexport function isValidDate(date) {\n return date instanceof Date && !isNaN(date.valueOf());\n}\n","// Shafaq is the twilight in the sky. Different madhabs define the appearance of\n// twilight differently. These values are used by the MoonsightingComittee method\n// for the different ways to calculate Isha.\nexport const Shafaq = {\n // General is a combination of Ahmer and Abyad.\n General: 'general',\n\n // Ahmer means the twilight is the red glow in the sky. Used by the Shafi, Maliki, and Hanbali madhabs.\n Ahmer: 'ahmer',\n\n // Abyad means the twilight is the white glow in the sky. Used by the Hanafi madhab.\n Abyad: 'abyad'\n};\n","/* eslint-disable max-params, max-lines */\nimport { degreesToRadians, radiansToDegrees, unwindAngle, normalizeToScale, quadrantShiftAngle } from './MathUtils';\nimport { dateByAddingSeconds } from './DateUtils';\nimport { Shafaq } from './Shafaq';\n\nconst Astronomical = {\n\n /* The geometric mean longitude of the sun in degrees. */\n meanSolarLongitude(julianCentury) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 163 */\n const term1 = 280.4664567;\n const term2 = 36000.76983 * T;\n const term3 = 0.0003032 * Math.pow(T, 2);\n const L0 = term1 + term2 + term3;\n return unwindAngle(L0);\n },\n\n /* The geometric mean longitude of the moon in degrees. */\n meanLunarLongitude(julianCentury) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 144 */\n const term1 = 218.3165;\n const term2 = 481267.8813 * T;\n const Lp = term1 + term2;\n return unwindAngle(Lp);\n },\n\n ascendingLunarNodeLongitude(julianCentury) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 144 */\n const term1 = 125.04452;\n const term2 = 1934.136261 * T;\n const term3 = 0.0020708 * Math.pow(T, 2);\n const term4 = Math.pow(T, 3) / 450000;\n const Omega = term1 - term2 + term3 + term4;\n return unwindAngle(Omega);\n },\n\n /* The mean anomaly of the sun. */\n meanSolarAnomaly(julianCentury) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 163 */\n const term1 = 357.52911;\n const term2 = 35999.05029 * T;\n const term3 = 0.0001537 * Math.pow(T, 2);\n const M = term1 + term2 - term3;\n return unwindAngle(M);\n },\n\n /* The Sun's equation of the center in degrees. */\n solarEquationOfTheCenter(julianCentury, meanAnomaly) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 164 */\n const Mrad = degreesToRadians(meanAnomaly);\n const term1 = (1.914602 - (0.004817 * T) - (0.000014 * Math.pow(T, 2))) * Math.sin(Mrad);\n const term2 = (0.019993 - (0.000101 * T)) * Math.sin(2 * Mrad);\n const term3 = 0.000289 * Math.sin(3 * Mrad);\n return term1 + term2 + term3;\n },\n\n /* The apparent longitude of the Sun, referred to the\n true equinox of the date. */\n apparentSolarLongitude(julianCentury, meanLongitude) {\n const T = julianCentury;\n const L0 = meanLongitude;\n /* Equation from Astronomical Algorithms page 164 */\n const longitude = L0 + Astronomical.solarEquationOfTheCenter(T, Astronomical.meanSolarAnomaly(T));\n const Omega = 125.04 - (1934.136 * T);\n const Lambda = longitude - 0.00569 - (0.00478 * Math.sin(degreesToRadians(Omega)));\n return unwindAngle(Lambda);\n },\n\n /* The mean obliquity of the ecliptic, formula\n adopted by the International Astronomical Union.\n Represented in degrees. */\n meanObliquityOfTheEcliptic(julianCentury) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 147 */\n const term1 = 23.439291;\n const term2 = 0.013004167 * T;\n const term3 = 0.0000001639 * Math.pow(T, 2);\n const term4 = 0.0000005036 * Math.pow(T, 3);\n return term1 - term2 - term3 + term4;\n },\n\n /* The mean obliquity of the ecliptic, corrected for\n calculating the apparent position of the sun, in degrees. */\n apparentObliquityOfTheEcliptic(julianCentury, meanObliquityOfTheEcliptic) {\n const T = julianCentury;\n const Epsilon0 = meanObliquityOfTheEcliptic;\n /* Equation from Astronomical Algorithms page 165 */\n const O = 125.04 - (1934.136 * T);\n return Epsilon0 + (0.00256 * Math.cos(degreesToRadians(O)));\n },\n\n /* Mean sidereal time, the hour angle of the vernal equinox, in degrees. */\n meanSiderealTime(julianCentury) {\n const T = julianCentury;\n /* Equation from Astronomical Algorithms page 165 */\n const JD = (T * 36525) + 2451545.0;\n const term1 = 280.46061837;\n const term2 = 360.98564736629 * (JD - 2451545);\n const term3 = 0.000387933 * Math.pow(T, 2);\n const term4 = Math.pow(T, 3) / 38710000;\n const Theta = term1 + term2 + term3 - term4;\n return unwindAngle(Theta)\n },\n\n nutationInLongitude(julianCentury, solarLongitude, lunarLongitude, ascendingNode) {\n const L0 = solarLongitude;\n const Lp = lunarLongitude;\n const Omega = ascendingNode;\n /* Equation from Astronomical Algorithms page 144 */\n const term1 = (-17.2/3600) * Math.sin(degreesToRadians(Omega));\n const term2 = (1.32/3600) * Math.sin(2 * degreesToRadians(L0));\n const term3 = (0.23/3600) * Math.sin(2 * degreesToRadians(Lp));\n const term4 = (0.21/3600) * Math.sin(2 * degreesToRadians(Omega));\n return term1 - term2 - term3 + term4;\n },\n\n nutationInObliquity(julianCentury, solarLongitude, lunarLongitude, ascendingNode) {\n const L0 = solarLongitude;\n const Lp = lunarLongitude;\n const Omega = ascendingNode;\n /* Equation from Astronomical Algorithms page 144 */\n const term1 = (9.2/3600) * Math.cos(degreesToRadians(Omega));\n const term2 = (0.57/3600) * Math.cos(2 * degreesToRadians(L0));\n const term3 = (0.10/3600) * Math.cos(2 * degreesToRadians(Lp));\n const term4 = (0.09/3600) * Math.cos(2 * degreesToRadians(Omega));\n return term1 + term2 + term3 - term4;\n },\n\n altitudeOfCelestialBody(observerLatitude, declination, localHourAngle) {\n const Phi = observerLatitude;\n const delta = declination;\n const H = localHourAngle;\n /* Equation from Astronomical Algorithms page 93 */\n const term1 = Math.sin(degreesToRadians(Phi)) * Math.sin(degreesToRadians(delta));\n const term2 = Math.cos(degreesToRadians(Phi)) * Math.cos(degreesToRadians(delta)) * Math.cos(degreesToRadians(H));\n return radiansToDegrees(Math.asin(term1 + term2));\n },\n\n approximateTransit(longitude, siderealTime, rightAscension) {\n const L = longitude;\n const Theta0 = siderealTime;\n const a2 = rightAscension;\n /* Equation from page Astronomical Algorithms 102 */\n const Lw = L * -1;\n return normalizeToScale((a2 + Lw - Theta0) / 360, 1);\n },\n\n /* The time at which the sun is at its highest point in the sky (in universal time) */\n correctedTransit(approximateTransit, longitude, siderealTime, rightAscension, previousRightAscension, nextRightAscension) {\n const m0 = approximateTransit;\n const L = longitude;\n const Theta0 = siderealTime;\n const a2 = rightAscension;\n const a1 = previousRightAscension;\n const a3 = nextRightAscension;\n /* Equation from page Astronomical Algorithms 102 */\n const Lw = L * -1;\n const Theta = unwindAngle((Theta0 + (360.985647 * m0)));\n const a = unwindAngle(Astronomical.interpolateAngles(a2, a1, a3, m0));\n const H = quadrantShiftAngle(Theta - Lw - a);\n const dm = H / -360;\n return (m0 + dm) * 24;\n },\n\n correctedHourAngle(approximateTransit, angle, coordinates, afterTransit, siderealTime,\n rightAscension, previousRightAscension, nextRightAscension, declination, previousDeclination, nextDeclination) {\n const m0 = approximateTransit;\n const h0 = angle;\n const Theta0 = siderealTime;\n const a2 = rightAscension;\n const a1 = previousRightAscension;\n const a3 = nextRightAscension;\n const d2 = declination;\n const d1 = previousDeclination;\n const d3 = nextDeclination;\n\n /* Equation from page Astronomical Algorithms 102 */\n const Lw = coordinates.longitude * -1;\n const term1 = Math.sin(degreesToRadians(h0)) - (Math.sin(degreesToRadians(coordinates.latitude)) * Math.sin(degreesToRadians(d2)));\n const term2 = Math.cos(degreesToRadians(coordinates.latitude)) * Math.cos(degreesToRadians(d2));\n const H0 = radiansToDegrees(Math.acos(term1 / term2));\n const m = afterTransit ? m0 + (H0 / 360) : m0 - (H0 / 360);\n const Theta = unwindAngle((Theta0 + (360.985647 * m)));\n const a = unwindAngle(Astronomical.interpolateAngles(a2, a1, a3, m));\n const delta = Astronomical.interpolate(d2, d1, d3, m);\n const H = (Theta - Lw - a);\n const h = Astronomical.altitudeOfCelestialBody(coordinates.latitude, delta, H);\n const term3 = h - h0;\n const term4 = 360 * Math.cos(degreesToRadians(delta)) * Math.cos(degreesToRadians(coordinates.latitude)) * Math.sin(degreesToRadians(H));\n const dm = term3 / term4;\n return (m + dm) * 24;\n },\n\n /* Interpolation of a value given equidistant\n previous and next values and a factor\n equal to the fraction of the interpolated\n point's time over the time between values. */\n interpolate(y2, y1, y3, n) {\n /* Equation from Astronomical Algorithms page 24 */\n const a = y2 - y1;\n const b = y3 - y2;\n const c = b - a;\n return y2 + ((n/2) * (a + b + (n * c)));\n },\n\n /* Interpolation of three angles, accounting for\n angle unwinding. */\n interpolateAngles(y2, y1, y3, n) {\n /* Equation from Astronomical Algorithms page 24 */\n const a = unwindAngle(y2 - y1);\n const b = unwindAngle(y3 - y2);\n const c = b - a;\n return y2 + ((n/2) * (a + b + (n * c)));\n },\n\n /* The Julian Day for the given Gregorian date components. */\n julianDay(year, month, day, hours) {\n /* Equation from Astronomical Algorithms page 60 */\n if (typeof hours === 'undefined') {\n hours = 0;\n }\n\n const trunc = Math.trunc || function (x) { return x < 0 ? Math.ceil(x) : Math.floor(x); };\n\n const Y = trunc(month > 2 ? year : year - 1);\n const M = trunc(month > 2 ? month : month + 12);\n const D = day + (hours / 24);\n\n const A = trunc(Y/100);\n const B = trunc(2 - A + trunc(A/4));\n\n const i0 = trunc(365.25 * (Y + 4716));\n const i1 = trunc(30.6001 * (M + 1));\n\n return i0 + i1 + D + B - 1524.5;\n },\n\n /* Julian century from the epoch. */\n julianCentury(julianDay) {\n /* Equation from Astronomical Algorithms page 163 */\n return (julianDay - 2451545.0) / 36525;\n },\n\n /* Whether or not a year is a leap year (has 366 days). */\n isLeapYear(year) {\n if (year % 4 !== 0) {\n return false;\n }\n\n if (year % 100 === 0 && year % 400 !== 0) {\n return false;\n }\n\n return true;\n },\n\n seasonAdjustedMorningTwilight(latitude, dayOfYear, year, sunrise) {\n const a = 75 + ((28.65 / 55.0) * Math.abs(latitude));\n const b = 75 + ((19.44 / 55.0) * Math.abs(latitude));\n const c = 75 + ((32.74 / 55.0) * Math.abs(latitude));\n const d = 75 + ((48.10 / 55.0) * Math.abs(latitude));\n\n const adjustment = (function() {\n const dyy = Astronomical.daysSinceSolstice(dayOfYear, year, latitude);\n if ( dyy < 91) {\n return a + ( b - a ) / 91.0 * dyy;\n } else if ( dyy < 137) {\n return b + ( c - b ) / 46.0 * ( dyy - 91 );\n } else if ( dyy < 183 ) {\n return c + ( d - c ) / 46.0 * ( dyy - 137 );\n } else if ( dyy < 229 ) {\n return d + ( c - d ) / 46.0 * ( dyy - 183 );\n } else if ( dyy < 275 ) {\n return c + ( b - c ) / 46.0 * ( dyy - 229 );\n } else {\n return b + ( a - b ) / 91.0 * ( dyy - 275 );\n }\n })();\n\n return dateByAddingSeconds(sunrise, Math.round(adjustment * -60.0));\n },\n\n seasonAdjustedEveningTwilight(latitude, dayOfYear, year, sunset, shafaq) {\n let a, b, c, d;\n if (shafaq === Shafaq.Ahmer) {\n a = 62 + ((17.40 / 55.0) * Math.abs(latitude));\n b = 62 - ((7.160 / 55.0) * Math.abs(latitude));\n c = 62 + ((5.120 / 55.0) * Math.abs(latitude));\n d = 62 + ((19.44 / 55.0) * Math.abs(latitude));\n } else if (shafaq === Shafaq.Abyad) {\n a = 75 + ((25.60 / 55.0) * Math.abs(latitude));\n b = 75 + ((7.160 / 55.0) * Math.abs(latitude));\n c = 75 + ((36.84 / 55.0) * Math.abs(latitude));\n d = 75 + ((81.84 / 55.0) * Math.abs(latitude));\n } else {\n a = 75 + ((25.60 / 55.0) * Math.abs(latitude));\n b = 75 + ((2.050 / 55.0) * Math.abs(latitude));\n c = 75 - ((9.210 / 55.0) * Math.abs(latitude));\n d = 75 + ((6.140 / 55.0) * Math.abs(latitude));\n }\n\n const adjustment = (function() {\n const dyy = Astronomical.daysSinceSolstice(dayOfYear, year, latitude);\n if ( dyy < 91) {\n return a + ( b - a ) / 91.0 * dyy;\n } else if ( dyy < 137) {\n return b + ( c - b ) / 46.0 * ( dyy - 91 );\n } else if ( dyy < 183 ) {\n return c + ( d - c ) / 46.0 * ( dyy - 137 );\n } else if ( dyy < 229 ) {\n return d + ( c - d ) / 46.0 * ( dyy - 183 );\n } else if ( dyy < 275 ) {\n return c + ( b - c ) / 46.0 * ( dyy - 229 );\n } else {\n return b + ( a - b ) / 91.0 * ( dyy - 275 );\n }\n })();\n\n return dateByAddingSeconds(sunset, Math.round(adjustment * 60.0));\n },\n\n daysSinceSolstice(dayOfYear, year, latitude) {\n let daysSinceSolstice = 0;\n const northernOffset = 10;\n const southernOffset = Astronomical.isLeapYear(year) ? 173 : 172;\n const daysInYear = Astronomical.isLeapYear(year) ? 366 : 365;\n\n if (latitude >= 0) {\n daysSinceSolstice = dayOfYear + northernOffset;\n if (daysSinceSolstice >= daysInYear) {\n daysSinceSolstice = daysSinceSolstice - daysInYear;\n }\n } else {\n daysSinceSolstice = dayOfYear - southernOffset;\n if (daysSinceSolstice < 0) {\n daysSinceSolstice = daysSinceSolstice + daysInYear;\n }\n }\n\n return daysSinceSolstice;\n }\n};\n\nexport default Astronomical;","import Astronomical from './Astronomical';\nimport { degreesToRadians, radiansToDegrees, unwindAngle } from './MathUtils';\n\nexport default class SolarCoordinates {\n constructor(julianDay) {\n const T = Astronomical.julianCentury(julianDay);\n const L0 = Astronomical.meanSolarLongitude(T);\n const Lp = Astronomical.meanLunarLongitude(T);\n const Omega = Astronomical.ascendingLunarNodeLongitude(T);\n const Lambda = degreesToRadians(Astronomical.apparentSolarLongitude(T, L0));\n const Theta0 = Astronomical.meanSiderealTime(T);\n const dPsi = Astronomical.nutationInLongitude(T, L0, Lp, Omega);\n const dEpsilon = Astronomical.nutationInObliquity(T, L0, Lp, Omega);\n const Epsilon0 = Astronomical.meanObliquityOfTheEcliptic(T);\n const EpsilonApparent = degreesToRadians(Astronomical.apparentObliquityOfTheEcliptic(T, Epsilon0));\n\n /* declination: The declination of the sun, the angle between\n the rays of the Sun and the plane of the Earth's\n equator, in degrees.\n Equation from Astronomical Algorithms page 165 */\n this.declination = radiansToDegrees(Math.asin(Math.sin(EpsilonApparent) * Math.sin(Lambda)));\n\n /* rightAscension: Right ascension of the Sun, the angular distance on the\n celestial equator from the vernal equinox to the hour circle,\n in degrees.\n Equation from Astronomical Algorithms page 165 */\n this.rightAscension = unwindAngle(radiansToDegrees(Math.atan2(Math.cos(EpsilonApparent) * Math.sin(Lambda), Math.cos(Lambda))));\n\n /* apparentSiderealTime: Apparent sidereal time, the hour angle of the vernal\n equinox, in degrees.\n Equation from Astronomical Algorithms page 88 */\n this.apparentSiderealTime = Theta0 + (((dPsi * 3600) * Math.cos(degreesToRadians(Epsilon0 + dEpsilon))) / 3600);\n }\n}\n\n","import Astronomical from './Astronomical';\nimport { degreesToRadians, radiansToDegrees } from './MathUtils'\nimport SolarCoordinates from './SolarCoordinates';\n\nexport default class SolarTime {\n constructor(date, coordinates) {\n const julianDay = Astronomical.julianDay(date.getFullYear(), date.getMonth() + 1, date.getDate(), 0);\n\n this.observer = coordinates;\n this.solar = new SolarCoordinates(julianDay);\n\n this.prevSolar = new SolarCoordinates(julianDay - 1);\n this.nextSolar = new SolarCoordinates(julianDay + 1);\n\n const m0 = Astronomical.approximateTransit(coordinates.longitude, this.solar.apparentSiderealTime, this.solar.rightAscension);\n const solarAltitude = -50.0 / 60.0;\n\n this.approxTransit = m0;\n\n this.transit = Astronomical.correctedTransit(m0, coordinates.longitude, this.solar.apparentSiderealTime, \n this.solar.rightAscension, this.prevSolar.rightAscension, this.nextSolar.rightAscension);\n\n this.sunrise = Astronomical.correctedHourAngle(m0, solarAltitude, coordinates, false, this.solar.apparentSiderealTime, \n this.solar.rightAscension, this.prevSolar.rightAscension, this.nextSolar.rightAscension, \n this.solar.declination, this.prevSolar.declination, this.nextSolar.declination);\n\n this.sunset = Astronomical.correctedHourAngle(m0, solarAltitude, coordinates, true, this.solar.apparentSiderealTime, \n this.solar.rightAscension, this.prevSolar.rightAscension, this.nextSolar.rightAscension, \n this.solar.declination, this.prevSolar.declination, this.nextSolar.declination);\n }\n\n hourAngle(angle, afterTransit) {\n return Astronomical.correctedHourAngle(this.approxTransit, angle, this.observer, afterTransit, this.solar.apparentSiderealTime, \n this.solar.rightAscension, this.prevSolar.rightAscension, this.nextSolar.rightAscension, \n this.solar.declination, this.prevSolar.declination, this.nextSolar.declination);\n }\n\n afternoon(shadowLength) {\n // TODO source shadow angle calculation\n const tangent = Math.abs(this.observer.latitude - this.solar.declination);\n const inverse = shadowLength + Math.tan(degreesToRadians(tangent));\n const angle = radiansToDegrees(Math.atan(1.0 / inverse));\n return this.hourAngle(angle, true);\n }\n}\n\n\n","export default class TimeComponents {\n constructor(number) {\n this.hours = Math.floor(number);\n this.minutes = Math.floor((number - this.hours) * 60);\n this.seconds = Math.floor((number - (this.hours + this.minutes / 60)) * 60 * 60);\n return this;\n }\n \n utcDate(year, month, date) {\n return new Date(Date.UTC(year, month, date, this.hours, this.minutes, this.seconds));\n }\n}\n","const Prayer = {\n Fajr: 'fajr',\n Sunrise: 'sunrise',\n Dhuhr: 'dhuhr',\n Asr: 'asr',\n Maghrib: 'maghrib',\n Isha: 'isha',\n None: 'none'\n};\n\nexport default Prayer;","export const Madhab = {\n Shafi: 'shafi',\n Hanafi: 'hanafi'\n};\n\nexport function shadowLength(madhab) {\n switch (madhab) {\n case Madhab.Shafi:\n return 1;\n case Madhab.Hanafi:\n return 2\n default:\n throw \"Invalid Madhab\";\n }\n}\n","import SolarTime from './SolarTime';\nimport { dateByAddingDays } from './DateUtils';\n\nexport const PolarCircleResolution = {\n AqrabBalad: 'AqrabBalad',\n AqrabYaum: 'AqrabYaum',\n Unresolved: 'Unresolved'\n};\n\nconst LATITUDE_VARIATION_STEP = 0.5; // Degrees to add/remove at each resolution step\nconst UNSAFE_LATITUDE = 65; // Based on https://en.wikipedia.org/wiki/Midnight_sun\n\nconst isValidSolarTime = (solarTime) => solarTime && !isNaN(solarTime.sunrise) && !isNaN(solarTime.sunset);\n\nconst aqrabYaumResolver = (coordinates, date, daysAdded = 1, direction = 1) => {\n if (daysAdded > Math.ceil(365 / 2)) {\n return null;\n }\n const testDate = new Date(date.getTime());\n testDate.setDate(testDate.getDate() + (direction * daysAdded));\n const tomorrow = dateByAddingDays(testDate, 1);\n const solarTime = new SolarTime(testDate, coordinates);\n const tomorrowSolarTime = new SolarTime(tomorrow, coordinates);\n\n if (!isValidSolarTime(solarTime) || !isValidSolarTime(tomorrowSolarTime)) {\n return aqrabYaumResolver(coordinates, date, daysAdded + (direction > 0 ? 0 : 1), -direction);\n }\n\n return {\n date,\n tomorrow,\n coordinates,\n solarTime,\n tomorrowSolarTime,\n };\n}\n\nconst aqrabBaladResolver = (coordinates, date, latitude) => {\n const solarTime = new SolarTime(date, { ...coordinates, latitude });\n const tomorrow = dateByAddingDays(date, 1);\n const tomorrowSolarTime = new SolarTime(tomorrow, { ...coordinates, latitude });\n if (!isValidSolarTime(solarTime) || !isValidSolarTime(tomorrowSolarTime)) {\n return (Math.abs(latitude) >= UNSAFE_LATITUDE) ?\n aqrabBaladResolver(coordinates, date, latitude - Math.sign(latitude) * LATITUDE_VARIATION_STEP)\n : null;\n }\n\n return {\n date,\n tomorrow,\n coordinates: { latitude, longitude: coordinates.longitude },\n solarTime,\n tomorrowSolarTime,\n };\n};\n\nexport const polarCircleResolvedValues = (resolver, date, coordinates) => {\n const defaultReturn = {\n date,\n tomorrow: dateByAddingDays(date, 1),\n coordinates,\n solarTime: new SolarTime(date, coordinates),\n tomorrowSolarTime: new SolarTime(dateByAddingDays(date, 1), coordinates),\n };\n\n switch (resolver) {\n case PolarCircleResolution.AqrabYaum: {\n return aqrabYaumResolver(coordinates, date) || defaultReturn;\n }\n case PolarCircleResolution.AqrabBalad: {\n const { latitude } = coordinates;\n return aqrabBaladResolver(coordinates, date, latitude - (Math.sign(latitude) * LATITUDE_VARIATION_STEP)) || defaultReturn;\n }\n default: {\n return defaultReturn;\n }\n }\n};\n","import SolarTime from './SolarTime';\nimport TimeComponents from './TimeComponents';\nimport Prayer from './Prayer';\nimport Astronomical from './Astronomical';\nimport {\n dateByAddingDays,\n dateByAddingMinutes,\n dateByAddingSeconds,\n roundedMinute,\n dayOfYear,\n isValidDate\n} from './DateUtils';\nimport { shadowLength } from './Madhab';\nimport { PolarCircleResolution, polarCircleResolvedValues } from './PolarCircleResolution';\n\nexport default class PrayerTimes {\n // eslint-disable-next-line complexity\n constructor(coordinates, date, calculationParameters) {\n this.coordinates = coordinates;\n this.date = date;\n this.calculationParameters = calculationParameters;\n\n let solarTime = new SolarTime(date, coordinates);\n\n let fajrTime;\n let sunriseTime;\n let dhuhrTime;\n let asrTime;\n let maghribTime;\n let ishaTime;\n\n let nightFraction;\n\n dhuhrTime = new TimeComponents(solarTime.transit).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n sunriseTime = new TimeComponents(solarTime.sunrise).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n let sunsetTime = new TimeComponents(solarTime.sunset).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n const tomorrow = dateByAddingDays(date, 1);\n let tomorrowSolarTime = new SolarTime(tomorrow, coordinates);\n\n const polarCircleResolver = calculationParameters.polarCircleResolution;\n if (\n (!isValidDate(sunriseTime) || !isValidDate(sunsetTime) || isNaN(tomorrowSolarTime.sunrise))\n && polarCircleResolver !== PolarCircleResolution.Unresolved\n ) {\n const resolved = polarCircleResolvedValues(polarCircleResolver, date, coordinates);\n solarTime = resolved.solarTime;\n tomorrowSolarTime = resolved.tomorrowSolarTime;\n const dateComponents = [date.getFullYear(), date.getMonth(), date.getDate()];\n\n dhuhrTime = new TimeComponents(solarTime.transit).utcDate(...dateComponents);\n sunriseTime = new TimeComponents(solarTime.sunrise).utcDate(...dateComponents);\n sunsetTime = new TimeComponents(solarTime.sunset).utcDate(...dateComponents);\n }\n\n // eslint-disable-next-line prefer-const\n asrTime = new TimeComponents(solarTime.afternoon(shadowLength(calculationParameters.madhab))).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n\n const tomorrowSunrise = new TimeComponents(tomorrowSolarTime.sunrise).utcDate(tomorrow.getFullYear(), tomorrow.getMonth(), tomorrow.getDate());\n const night = (tomorrowSunrise - sunsetTime) / 1000;\n\n fajrTime = new TimeComponents(solarTime.hourAngle(-1 * calculationParameters.fajrAngle, false)).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n\n // special case for moonsighting committee above latitude 55\n if (calculationParameters.method === \"MoonsightingCommittee\" && coordinates.latitude >= 55) {\n nightFraction = night / 7;\n fajrTime = dateByAddingSeconds(sunriseTime, -nightFraction);\n }\n\n const safeFajr = (function () {\n if (calculationParameters.method === \"MoonsightingCommittee\") {\n return Astronomical.seasonAdjustedMorningTwilight(coordinates.latitude, dayOfYear(date), date.getFullYear(), sunriseTime);\n }\n else {\n const portion = calculationParameters.nightPortions().fajr;\n nightFraction = portion * night;\n return dateByAddingSeconds(sunriseTime, -nightFraction);\n }\n })();\n\n if (fajrTime === null || isNaN(fajrTime.getTime()) || safeFajr > fajrTime) {\n fajrTime = safeFajr;\n }\n\n if (calculationParameters.ishaInterval > 0) {\n ishaTime = dateByAddingMinutes(sunsetTime, calculationParameters.ishaInterval);\n } else {\n ishaTime = new TimeComponents(solarTime.hourAngle(-1 * calculationParameters.ishaAngle, true)).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n\n // special case for moonsighting committee above latitude 55\n if (calculationParameters.method === \"MoonsightingCommittee\" && coordinates.latitude >= 55) {\n nightFraction = night / 7;\n ishaTime = dateByAddingSeconds(sunsetTime, nightFraction);\n }\n\n const safeIsha = (function () {\n if (calculationParameters.method === \"MoonsightingCommittee\") {\n return Astronomical.seasonAdjustedEveningTwilight(coordinates.latitude, dayOfYear(date), date.getFullYear(), sunsetTime, calculationParameters.shafaq);\n }\n else {\n const portion = calculationParameters.nightPortions().isha;\n nightFraction = portion * night;\n return dateByAddingSeconds(sunsetTime, nightFraction);\n }\n })();\n\n if (ishaTime == null || isNaN(ishaTime.getTime()) || safeIsha < ishaTime) {\n ishaTime = safeIsha;\n }\n }\n\n maghribTime = sunsetTime;\n if (calculationParameters.maghribAngle) {\n const angleBasedMaghrib = new TimeComponents(solarTime.hourAngle(-1 * calculationParameters.maghribAngle, true)).utcDate(date.getFullYear(), date.getMonth(), date.getDate());\n if (sunsetTime < angleBasedMaghrib && ishaTime > angleBasedMaghrib) {\n maghribTime = angleBasedMaghrib;\n }\n }\n\n const fajrAdjustment = (calculationParameters.adjustments.fajr || 0) + (calculationParameters.methodAdjustments.fajr || 0);\n const sunriseAdjustment = (calculationParameters.adjustments.sunrise || 0) + (calculationParameters.methodAdjustments.sunrise || 0);\n const dhuhrAdjustment = (calculationParameters.adjustments.dhuhr || 0) + (calculationParameters.methodAdjustments.dhuhr || 0);\n const asrAdjustment = (calculationParameters.adjustments.asr || 0) + (calculationParameters.methodAdjustments.asr || 0);\n const maghribAdjustment = (calculationParameters.adjustments.maghrib || 0) + (calculationParameters.methodAdjustments.maghrib || 0);\n const ishaAdjustment = (calculationParameters.adjustments.isha || 0) + (calculationParameters.methodAdjustments.isha || 0);\n\n this.fajr = roundedMinute(dateByAddingMinutes(fajrTime, fajrAdjustment), calculationParameters.rounding);\n this.sunrise = roundedMinute(dateByAddingMinutes(sunriseTime, sunriseAdjustment), calculationParameters.rounding);\n this.dhuhr = roundedMinute(dateByAddingMinutes(dhuhrTime, dhuhrAdjustment), calculationParameters.rounding);\n this.asr = roundedMinute(dateByAddingMinutes(asrTime, asrAdjustment), calculationParameters.rounding);\n this.maghrib = roundedMinute(dateByAddingMinutes(maghribTime, maghribAdjustment), calculationParameters.rounding);\n this.isha = roundedMinute(dateByAddingMinutes(ishaTime, ishaAdjustment), calculationParameters.rounding);\n }\n\n timeForPrayer(prayer) {\n if (prayer === Prayer.Fajr) {\n return this.fajr;\n }\n else if (prayer === Prayer.Sunrise) {\n return this.sunrise;\n }\n else if (prayer === Prayer.Dhuhr) {\n return this.dhuhr;\n }\n else if (prayer === Prayer.Asr) {\n return this.asr;\n }\n else if (prayer === Prayer.Maghrib) {\n return this.maghrib;\n }\n else if (prayer === Prayer.Isha) {\n return this.isha;\n }\n else {\n return null;\n }\n }\n\n currentPrayer(date) {\n if (typeof date === 'undefined') {\n date = new Date();\n }\n if (date >= this.isha) {\n return Prayer.Isha;\n }\n else if (date >= this.maghrib) {\n return Prayer.Maghrib;\n }\n else if (date >= this.asr) {\n return Prayer.Asr;\n }\n else if (date >= this.dhuhr) {\n return Prayer.Dhuhr;\n }\n else if (date >= this.sunrise) {\n return Prayer.Sunrise;\n }\n else if (date >= this.fajr) {\n return Prayer.Fajr;\n }\n else {\n return Prayer.None;\n }\n }\n\n nextPrayer(date) {\n if (typeof date === 'undefined') {\n date = new Date();\n }\n if (date >= this.isha) {\n return Prayer.None;\n }\n else if (date >= this.maghrib) {\n return Prayer.Isha;\n }\n else if (date >= this.asr) {\n return Prayer.Maghrib;\n }\n else if (date >= this.dhuhr) {\n return Prayer.Asr;\n }\n else if (date >= this.sunrise) {\n return Prayer.Dhuhr;\n }\n else if (date >= this.fajr) {\n return Prayer.Sunrise;\n }\n else {\n return Prayer.Fajr;\n }\n }\n}\n\n","const HighLatitudeRule = {\n MiddleOfTheNight: 'middleofthenight',\n SeventhOfTheNight: 'seventhofthenight',\n TwilightAngle: 'twilightangle',\n\n recommended(coordinates) {\n if (coordinates.latitude > 48) {\n return HighLatitudeRule.SeventhOfTheNight;\n } else {\n return HighLatitudeRule.MiddleOfTheNight;\n }\n }\n};\n\nexport default HighLatitudeRule;","import { Madhab } from './Madhab';\nimport HighLatitudeRule from './HighLatitudeRule';\nimport { PolarCircleResolution } from './PolarCircleResolution';\nimport { Rounding } from './Rounding';\nimport { Shafaq } from './Shafaq';\n\nexport default class CalculationParameters {\n constructor(methodName, fajrAngle, ishaAngle, ishaInterval, maghribAngle) {\n // Name of the method, can be used to apply special behavior in calculations.\n // This property should not be manually modified.\n this.method = methodName || \"Other\";\n\n // Angle of the sun below the horizon used for calculating Fajr.\n this.fajrAngle = fajrAngle || 0;\n\n // Angle of the sun below the horizon used for calculating Isha.\n this.ishaAngle = ishaAngle || 0;\n\n // Minutes after Maghrib to determine time for Isha\n // if this value is greater than 0 then ishaAngle is not used.\n this.ishaInterval = ishaInterval || 0;\n\n // Angle of the sun below the horizon used for calculating Maghrib.\n // Only used by the Tehran method to account for lightness in the sky.\n this.maghribAngle = maghribAngle;\n\n // Madhab to determine how Asr is calculated.\n this.madhab = Madhab.Shafi;\n\n // Rule to determine the earliest time for Fajr and latest time for Isha\n // needed for high latitude locations where Fajr and Isha may not truly exist\n // or may present a hardship unless bound to a reasonable time.\n this.highLatitudeRule = HighLatitudeRule.MiddleOfTheNight;\n\n // Manual adjustments (in minutes) to be added to each prayer time.\n this.adjustments = { fajr: 0, sunrise: 0, dhuhr: 0, asr: 0, maghrib: 0, isha: 0 };\n\n // Adjustments set by a calculation method. This value should not be manually modified.\n this.methodAdjustments = { fajr: 0, sunrise: 0, dhuhr: 0, asr: 0, maghrib: 0, isha: 0 };\n\n // Rule to determine how to resolve prayer times inside the Polar Circle\n // where daylight or night may persist for more than 24 hours depending\n // on the season\n this.polarCircleResolution = PolarCircleResolution.Unresolved;\n\n // How seconds are rounded when calculating prayer times\n this.rounding = Rounding.Nearest;\n\n // Used by the MoonsightingCommittee method to determine how to calculate Isha\n this.shafaq = Shafaq.General;\n }\n\n nightPortions() {\n switch (this.highLatitudeRule) {\n case HighLatitudeRule.MiddleOfTheNight:\n return { fajr: 1 / 2, isha: 1 / 2 };\n case HighLatitudeRule.SeventhOfTheNight:\n return { fajr: 1 / 7, isha: 1 / 7 };\n case HighLatitudeRule.TwilightAngle:\n return { fajr: this.fajrAngle / 60, isha: this.ishaAngle / 60 };\n default:\n throw(`Invalid high latitude rule found when attempting to compute night portions: ${this.highLatitudeRule}`);\n }\n }\n}\n","import CalculationParameters from './CalculationParameters';\nimport { Rounding } from './Rounding';\n\nconst CalculationMethod = {\n // Muslim World League\n MuslimWorldLeague() {\n const params = new CalculationParameters(\"MuslimWorldLeague\", 18, 17);\n params.methodAdjustments = { dhuhr: 1 };\n return params;\n },\n\n // Egyptian General Authority of Survey\n Egyptian() {\n const params = new CalculationParameters(\"Egyptian\", 19.5, 17.5);\n params.methodAdjustments = { dhuhr: 1 };\n return params;\n },\n\n // University of Islamic Sciences, Karachi\n Karachi() {\n const params = new CalculationParameters(\"Karachi\", 18, 18);\n params.methodAdjustments = { dhuhr: 1 };\n return params;\n },\n\n // Umm al-Qura University, Makkah\n UmmAlQura() {\n return new CalculationParameters(\"UmmAlQura\", 18.5, 0, 90);\n },\n\n // Dubai\n Dubai() {\n const params = new CalculationParameters(\"Dubai\", 18.2, 18.2);\n params.methodAdjustments = { sunrise: -3, dhuhr: 3, asr: 3, maghrib: 3 };\n return params;\n },\n\n // Moonsighting Committee\n MoonsightingCommittee() {\n const params = new CalculationParameters(\"MoonsightingCommittee\", 18, 18);\n params.methodAdjustments = { dhuhr: 5, maghrib: 3 };\n return params;\n },\n\n // ISNA\n NorthAmerica() {\n const params = new CalculationParameters(\"NorthAmerica\", 15, 15);\n params.methodAdjustments = { dhuhr: 1 };\n return params;\n },\n\n // Kuwait\n Kuwait() {\n return new CalculationParameters(\"Kuwait\", 18, 17.5);\n },\n\n // Qatar\n Qatar() {\n return new CalculationParameters(\"Qatar\", 18, 0, 90);\n },\n\n // Singapore\n Singapore() {\n const params = new CalculationParameters(\"Singapore\", 20, 18);\n params.methodAdjustments = { dhuhr: 1 };\n params.rounding = Rounding.Up;\n return params;\n },\n\n // Institute of Geophysics, University of Tehran\n Tehran() {\n const params = new CalculationParameters(\"Tehran\", 17.7, 14, 0, 4.5);\n return params;\n },\n\n // Dianet\n Turkey() {\n const params = new CalculationParameters(\"Turkey\", 18, 17);\n params.methodAdjustments = { sunrise: -7, dhuhr: 5, asr: 4, maghrib: 7 };\n return params;\n },\n\n // Other\n Other() {\n return new CalculationParameters(\"Other\", 0, 0);\n }\n};\n\nexport default CalculationMethod;","import Coordinates from './Coordinates'\nimport { degreesToRadians, radiansToDegrees, unwindAngle } from './MathUtils'\n\nexport default function qibla(coordinates) {\n const makkah = new Coordinates(21.4225241, 39.8261818);\n\n // Equation from \"Spherical Trigonometry For the use of colleges and schools\" page 50\n const term1 = (\n Math.sin(degreesToRadians(makkah.longitude) -\n degreesToRadians(coordinates.longitude))\n );\n const term2 = (\n Math.cos(degreesToRadians(coordinates.latitude)) *\n Math.tan(degreesToRadians(makkah.latitude))\n );\n const term3 = (\n Math.sin(degreesToRadians(coordinates.latitude)) *\n Math.cos(degreesToRadians(makkah.longitude) -\n degreesToRadians(coordinates.longitude))\n );\n const angle = Math.atan2(term1, term2 - term3);\n\n return unwindAngle(radiansToDegrees(angle));\n}\n","import { dateByAddingDays, dateByAddingSeconds, roundedMinute } from './DateUtils';\nimport PrayerTimes from './PrayerTimes';\n\nexport default class SunnahTimes {\n constructor(prayerTimes) {\n const date = prayerTimes.date;\n const nextDay = dateByAddingDays(date, 1);\n const nextDayPrayerTimes = new PrayerTimes(prayerTimes.coordinates, nextDay, prayerTimes.calculationParameters);\n\n const nightDuration = (nextDayPrayerTimes.fajr.getTime() - prayerTimes.maghrib.getTime()) / 1000.0;\n\n this.middleOfTheNight = roundedMinute(dateByAddingSeconds(prayerTimes.maghrib, nightDuration / 2));\n this.lastThirdOfTheNight = roundedMinute(dateByAddingSeconds(prayerTimes.maghrib, nightDuration * (2 / 3)));\n }\n}\n\n","import Coordinates from './Coordinates';\nimport PrayerTimes from './PrayerTimes';\nimport Prayer from './Prayer';\nimport { Madhab } from './Madhab';\nimport HighLatitudeRule from './HighLatitudeRule';\nimport CalculationMethod from './CalculationMethod';\nimport CalculationParameters from './CalculationParameters';\nimport Qibla from './Qibla';\nimport SunnahTimes from './SunnahTimes';\nimport { PolarCircleResolution } from './PolarCircleResolution';\nimport { Rounding } from './Rounding';\nimport { Shafaq } from './Shafaq';\n\nconst adhan = {\n Prayer,\n Madhab,\n HighLatitudeRule,\n Coordinates,\n CalculationParameters,\n CalculationMethod,\n PrayerTimes,\n SunnahTimes,\n Qibla,\n PolarCircleResolution,\n Rounding,\n Shafaq\n};\n\nexport default adhan;"],"sourceRoot":""} \ No newline at end of file diff --git a/example.html b/example.html index b5fda04..f4e417b 100644 --- a/example.html +++ b/example.html @@ -28,7 +28,9 @@ const coordinates = new adhan.Coordinates(66.7222444, 17.7189); const params = adhan.CalculationMethod.MuslimWorldLeague(); - const date = new Date('2020-06-21 21:55') + params.polarCircleResolution = adhan.PolarCircleResolution.AqrabYaum; + params.highLatitudeRule = adhan.HighLatitudeRule.SeventhOfTheNight; + const date = new Date(2020, 05, 21); var prayerTimes = new adhan.PrayerTimes(coordinates, date, params); @@ -36,15 +38,15 @@ document.write('Raleigh, NC - Muslim World League\n'); document.write(`Prayer times for ${moment(date).format('MMMM DD, YYYY')}\n`); - document.write(`Fajr: ${moment(prayerTimes.fajr).tz('America/New_York').format('h:mm A')}\n`); - document.write(`Sunrise: ${moment(prayerTimes.sunrise).tz('America/New_York').format('h:mm A')}\n`); - document.write(`Dhuhr: ${moment(prayerTimes.dhuhr).tz('America/New_York').format('h:mm A')}\n`); - document.write(`Asr: ${moment(prayerTimes.asr).tz('America/New_York').format('h:mm A')}\n`); - document.write(`Maghrib: ${moment(prayerTimes.maghrib).tz('America/New_York').format('h:mm A')}\n`); - document.write(`Isha: ${moment(prayerTimes.isha).tz('America/New_York').format('h:mm A')}\n`); - - document.write(`middle of the night: ${moment(sunnahTimes.middleOfTheNight).tz('America/New_York').format('h:mm A')}\n`); - document.write(`last third of the night: ${moment(sunnahTimes.lastThirdOfTheNight).tz('America/New_York').format('h:mm A')}\n\n`); + document.write(`Fajr: ${moment(prayerTimes.fajr).tz('Europe/Stockholm').format('MMMM DD, YYYY h:mm A')}\n`); + document.write(`Sunrise: ${moment(prayerTimes.sunrise).tz('Europe/Stockholm').format('MMMM DD, YYYY h:mm A')}\n`); + document.write(`Dhuhr: ${moment(prayerTimes.dhuhr).tz('Europe/Stockholm').format('MMMM DD, YYYY h:mm A')}\n`); + document.write(`Asr: ${moment(prayerTimes.asr).tz('Europe/Stockholm').format('MMMM DD, YYYY h:mm A')}\n`); + document.write(`Maghrib: ${moment(prayerTimes.maghrib).tz('Europe/Stockholm').format('MMMM DD, YYYY h:mm A')}\n`); + document.write(`Isha: ${moment(prayerTimes.isha).tz('Europe/Stockholm').format('MMMM DD, YYYY h:mm A')}\n`); + + document.write(`middle of the night: ${moment(sunnahTimes.middleOfTheNight).tz('Europe/Stockholm').format('MMMM DD, YYYY h:mm A')}\n`); + document.write(`last third of the night: ${moment(sunnahTimes.lastThirdOfTheNight).tz('Europe/Stockholm').format('MMMM DD, YYYY h:mm A')}\n\n`); document.write(`Current Prayer: ${prayerName(prayerTimes.currentPrayer())}\n\n`); diff --git a/src/PrayerTimes.js b/src/PrayerTimes.js index 7f51cb6..d749d8b 100644 --- a/src/PrayerTimes.js +++ b/src/PrayerTimes.js @@ -34,7 +34,7 @@ export default class PrayerTimes { dhuhrTime = new TimeComponents(solarTime.transit).utcDate(date.getFullYear(), date.getMonth(), date.getDate()); sunriseTime = new TimeComponents(solarTime.sunrise).utcDate(date.getFullYear(), date.getMonth(), date.getDate()); let sunsetTime = new TimeComponents(solarTime.sunset).utcDate(date.getFullYear(), date.getMonth(), date.getDate()); - let tomorrow = dateByAddingDays(date, 1); + const tomorrow = dateByAddingDays(date, 1); let tomorrowSolarTime = new SolarTime(tomorrow, coordinates); const polarCircleResolver = calculationParameters.polarCircleResolution; @@ -43,10 +43,7 @@ export default class PrayerTimes { && polarCircleResolver !== PolarCircleResolution.Unresolved ) { const resolved = polarCircleResolvedValues(polarCircleResolver, date, coordinates); - this.coordinates = resolved.coordinates; - this.date.setTime(resolved.date.getTime()); solarTime = resolved.solarTime; - tomorrow = resolved.tomorrow; tomorrowSolarTime = resolved.tomorrowSolarTime; const dateComponents = [date.getFullYear(), date.getMonth(), date.getDate()]; diff --git a/test/adhan.test.js b/test/adhan.test.js index 99f4389..5093955 100644 --- a/test/adhan.test.js +++ b/test/adhan.test.js @@ -658,5 +658,22 @@ describe('Polar circle resolution cases', () => { expect(isValidDate(prayersTimes[prayerName])).toEqual(true); }); }); + + test("calculating times for the polar circle", () => { + const coordinates = new adhan.Coordinates(66.7222444, 17.7189); + const params = adhan.CalculationMethod.MuslimWorldLeague(); + params.polarCircleResolution = adhan.PolarCircleResolution.AqrabYaum; + params.highLatitudeRule = adhan.HighLatitudeRule.SeventhOfTheNight; + const date = new Date(2020, 5, 21); + + const p = new adhan.PrayerTimes(coordinates, date, params); + expect(moment(p.fajr).tz("Europe/Stockholm").format("MMMM DD, YYYY h:mm A")).toBe("June 21, 2020 12:40 AM"); + expect(moment(p.sunrise).tz("Europe/Stockholm").format("MMMM DD, YYYY h:mm A")).toBe("June 21, 2020 12:54 AM"); + expect(moment(p.dhuhr).tz("Europe/Stockholm").format("MMMM DD, YYYY h:mm A")).toBe("June 21, 2020 12:55 PM"); + expect(moment(p.asr).tz("Europe/Stockholm").format("MMMM DD, YYYY h:mm A")).toBe("June 21, 2020 5:49 PM"); + expect(moment(p.maghrib).tz("Europe/Stockholm").format("MMMM DD, YYYY h:mm A")).toBe("June 21, 2020 11:36 PM"); + expect(moment(p.isha).tz("Europe/Stockholm").format("MMMM DD, YYYY h:mm A")).toBe("June 21, 2020 11:51 PM"); + }); + }); }); \ No newline at end of file