mirror of
https://github.com/acamarata/pray-calc.git
synced 2026-06-30 19:04:26 +00:00
34 lines
758 B
JavaScript
34 lines
758 B
JavaScript
const { getSpa, calcSpa } = require('nrel-spa');
|
|
|
|
const date = new Date();
|
|
console.log(date)
|
|
|
|
/* NYC - minimum params
|
|
const city = "New York"
|
|
const lat = 40.7128;
|
|
const lng = -74.006;
|
|
const tz = -5;
|
|
const params = null
|
|
const angles = []
|
|
*/
|
|
|
|
// Jakarta - all params
|
|
const city = "Jakarta"
|
|
const lat = -6.2088
|
|
const lng = 106.8456
|
|
const tz = 7
|
|
const elevation = 18
|
|
const temperature = 26.56
|
|
const pressure = 1017
|
|
const params = {elevation, temperature, pressure}
|
|
const angles = [63.435]
|
|
|
|
|
|
// Get results
|
|
const get = getSpa(date, lat, lng); // minimal args
|
|
const calc = calcSpa(date, lat, lng, tz, params, angles);
|
|
|
|
// Print results
|
|
console.log(`\nTest: ${city} with current Date():\n`)
|
|
console.log("getSpa =", get, "\n");
|
|
console.log("calcSpa =", calc, "\n");
|