add phase name and symbol

This commit is contained in:
Ali Camarata 2023-11-13 22:24:17 +07:00
parent c1814c2783
commit 6380403cf7
4 changed files with 9 additions and 4 deletions

View file

@ -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

View file

@ -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

4
package-lock.json generated
View file

@ -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",

View file

@ -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": {