You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
isDaytime and isNightTime return incorrect values for polar day #59
For places where there's a polar day in the given time/date (see the example), isDaytime returns false and isNightTime returns true for all times of day (just opposite to reality).
I know this is an old bug, but I’ve been using Solar extensively for my project Solstice and polar days/nights are so tricky! I’ve figured out a workaround that involves checking whether the coordinates are within a polar circle:
Activity
daneden commentedon Jun 26, 2024
I know this is an old bug, but I’ve been using Solar extensively for my project Solstice and polar days/nights are so tricky! I’ve figured out a workaround that involves checking whether the coordinates are within a polar circle:
This works by:
isDaytimeif there is a sunrise/sunset (which is howisDaytimeworks under the hood anyway)isDaytimeif they don'ta. Which polar circle the coordinates are in
b. Whether the date lies within the northern hemisphere’s winter months
fix: isDaytime wrong during polar day (#59)
fix: isDaytime wrong during polar day (#59)
fix: isDaytime wrong during polar day (#59)