mirror of
https://github.com/acamarata/pray-calc.git
synced 2026-06-30 19:04:26 +00:00
add phase name and symbol
This commit is contained in:
parent
c1814c2783
commit
6380403cf7
4 changed files with 9 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
4
package-lock.json
generated
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
Loading…
Reference in a new issue