mirror of
https://github.com/acamarata/pray-calc.git
synced 2026-07-02 03:40:39 +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)
|
- Moved timezone to main args and changed default behavior (major)
|
||||||
- Updated test cases and readme to reflect new usage (minor)
|
- 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
|
- 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 position = getMoonPosition(date, latitude, longitude);
|
||||||
const illumination = getMoonIllumination(date);
|
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
|
// Calculate visibility considering all factors
|
||||||
const visibility = getMoonVisibility(phase, position, illumination, elevation, temp, pressure, humidity, clouds);
|
const visibility = getMoonVisibility(phase, position, illumination, elevation, temp, pressure, humidity, clouds);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
phase,
|
phase,
|
||||||
|
phaseName,
|
||||||
|
phaseSymbol,
|
||||||
position,
|
position,
|
||||||
illumination,
|
illumination,
|
||||||
visibility
|
visibility
|
||||||
|
|
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "praycalc",
|
"name": "praycalc",
|
||||||
"version": "1.3.0",
|
"version": "1.3.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "praycalc",
|
"name": "praycalc",
|
||||||
"version": "1.3.0",
|
"version": "1.3.1",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nrel-spa": "^1.2.2",
|
"nrel-spa": "^1.2.2",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "praycalc",
|
"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)",
|
"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",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue