From 6380403cf71fe4ca182922c219c7da9be848248f Mon Sep 17 00:00:00 2001 From: Ali Camarata Date: Mon, 13 Nov 2023 22:24:17 +0700 Subject: [PATCH] add phase name and symbol --- CHANGELOG.md | 2 +- getMoon.js | 5 +++++ package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7882c53..fc80b24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,6 @@ All notable changes to this project will be documented in this file. - Moved timezone to main args and changed default behavior (major) - Updated test cases and readme to reflect new usage (minor) -## [1.3.0] - 2013-11-13 +## [1.3.1] - 2013-11-13 - Major updates to getMoon with own functions diff --git a/getMoon.js b/getMoon.js index 7a37717..ab41c0b 100644 --- a/getMoon.js +++ b/getMoon.js @@ -21,11 +21,16 @@ function getMoon(date, latitude = 0, longitude = 0, elevation = 50, temp = 15, p const position = getMoonPosition(date, latitude, longitude); const illumination = getMoonIllumination(date); + const phaseName = ["New Moon", "Waxing Crescent", "First Quarter", "Waxing Gibbous", "Full Moon", "Waning Gibbous", "Last Quarter", "Waning Crescent"][Math.floor(phase * 8)] || "New Moon"; + const phaseSymbol = ["🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘"][Math.floor(phase * 8)] || "🌑"; + // Calculate visibility considering all factors const visibility = getMoonVisibility(phase, position, illumination, elevation, temp, pressure, humidity, clouds); return { phase, + phaseName, + phaseSymbol, position, illumination, visibility diff --git a/package-lock.json b/package-lock.json index 004d1a2..a3cc2de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "praycalc", - "version": "1.3.0", + "version": "1.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "praycalc", - "version": "1.3.0", + "version": "1.3.1", "license": "ISC", "dependencies": { "nrel-spa": "^1.2.2", diff --git a/package.json b/package.json index 8c57ee4..5ac9098 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "praycalc", - "version": "1.3.0", + "version": "1.3.1", "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": {