From 0cb2267da67f5bef3101f619bbd4be2792749414 Mon Sep 17 00:00:00 2001 From: Ali Camarata Date: Tue, 14 Nov 2023 12:25:53 +0700 Subject: [PATCH] updated to "pray-calc" and synodic accuracy --- README.md | 8 ++++---- getMoonPhase.js | 6 +++--- index.d.ts | 2 +- package-lock.json | 8 ++++---- package.json | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index ca8a979..a50cd88 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ -# praycalc +# pray-calc Prayer times calculator using nrel-spa and custom formula for Fajr and Isha angles (as well as traditional static angle methods in the All function). ## Installation ```bash -npm install praycalc +npm install pray-calc ``` ## Usage -Example of using praycalc to get prayer times: +Example of using pray-calc to get prayer times: ```js -const { getTimes, calcTimesAll } = require('praycalc'); +const { getTimes, calcTimesAll } = require('pray-calc'); const date = new Date(); diff --git a/getMoonPhase.js b/getMoonPhase.js index dd1ad4a..69eafd0 100644 --- a/getMoonPhase.js +++ b/getMoonPhase.js @@ -4,9 +4,9 @@ * @returns {number} The moon phase as a fraction from 0 (new moon) to just under 1 (end of lunar cycle). */ function getMoonPhase(date) { - const synodicMonth = 29.530588861; // Average length of a synodic month in days - // Most recent known new moon: November 13, 2023, 03:27 AM - const knownNewMoon = new Date(Date.UTC(2023, 10, 13, 3, 27, 0)); + const synodicMonth = 29.53058821398858; // Average length of a synodic month in days + // Most recent known new moon: November 13, 2023, 09:27 AM UTC + const knownNewMoon = new Date(Date.UTC(2023, 10, 13, 9, 27, 0)); // Convert both dates to the number of milliseconds since Unix Epoch and find the difference const diffInMilliseconds = date - knownNewMoon; diff --git a/index.d.ts b/index.d.ts index c76348f..e363622 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,5 @@ // index.d.ts -declare module 'praycalc' { +declare module 'pray-calc' { export function getMoon(date: Date, latitude?: number, longitude?: number, elevation?: number, temp?: number, pressure?: number, humidity?: number, clouds?: number): MoonDetails; export function getTimes(date: Date, lat: number, lng: number, tz: number, elevation?: number, temperature?: number, pressure?: number): TimesReturnType; export function calcTimes(date: Date, lat: number, lng: number, tz: number, elevation?: number, temperature?: number, pressure?: number): CalcTimesReturnType; diff --git a/package-lock.json b/package-lock.json index 6e8c29f..a359e1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "praycalc", - "version": "1.3.2", + "name": "pray-calc", + "version": "1.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "praycalc", - "version": "1.3.2", + "name": "pray-calc", + "version": "1.4.0", "license": "ISC", "dependencies": { "nrel-spa": "^1.2.2", diff --git a/package.json b/package.json index b0fb604..6fa6d78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "praycalc", - "version": "1.3.2", + "name": "pray-calc", + "version": "1.4.0", "description": "Prayer times calculator using nrel-spa and custom formula for Fajr and Isha angles (as well as traditional static angle methods in the All function)", "main": "index.js", "scripts": { @@ -8,7 +8,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/ussunnah/praycalc" + "url": "https://github.com/ussunnah/pray-calc" }, "author": "USF", "license": "ISC",