Skip to content

Commit bf35777

Browse files
committed
add alwaysUp/alwaysDown to getMoonTimes results
1 parent 7cb4a40 commit bf35777

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

suncalc.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,14 @@ SunCalc.getMoonTimes = function (date, lat, lng) {
283283
h0 = h2;
284284
}
285285

286-
return {
287-
rise: hoursLater(t, rise),
288-
set: hoursLater(t, set)
289-
};
286+
var result = {};
287+
288+
if (rise) result.rise = hoursLater(t, rise);
289+
if (set) result.set = hoursLater(t, set);
290+
291+
if (!rise && !set) result[ye > 0 ? 'alwaysUp' : 'alwaysDown'] = true;
292+
293+
return result;
290294
};
291295

292296

0 commit comments

Comments
 (0)