Ensure that timestamp is always a Date object

This commit is contained in:
D. Berge
2021-05-27 17:50:01 +02:00
parent cf171628cd
commit 91fd5e4559

View File

@@ -440,6 +440,7 @@ export default {
function isDay (srss, ts, lat, lng) {
if (isNaN(srss.sunriseEnd) || isNaN(srss.sunsetStart)) {
// Between March and September
ts = new Date(ts);
if (ts.getMonth() >= 2 && ts.getMonth() <= 8) {
// Polar day in the Northern hemisphere, night in the South
return lat > 0;