! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Locations with midnight sun erroneously display the nighttime icon
Status:
RESOLVED: FIXED
Product:
Xfce4-weather-plugin
Component:
General

Comments

Description Goran 2019-08-02 15:57:32 CEST
For locations which exhibit midnight sun (i.e. no sunset), the weather panel plugin erroneously displays the text "The sun never rises today.", which I suppose is technically correct, but the icon it shows is that of the Moon, while it should be that of the Sun.

Looking over the source, I've noticed that the default values of astro->sun_never_rises and astro->sun_never_sets are both set to "true" by default, because in this case, the sunrise API doesn't appear to provide them, but the is_night_time function only looks at the former, which results in the same (night-time) icon being displayed both for locations with midnight sun, as well as those with polar night.
Comment 1 Goran 2019-08-03 16:08:52 CEST
Created attachment 8839 
Fix for polar regions

This patch fixes the issue by adding the elevation of the 'solarnoon' and 'solarmidnight' parameters, which, unlike sunrise and sunset times, are guaranteed to be available by the current sunrise API, as well as adds separate formatting for transition periods (polar day -> regular and so on).
Note that due to bug 15308, the displayed icon may not be the correct one, despite the sunrise/sunset times being correct.
Comment 2 Git Bot editbugs 2020-03-01 05:50:11 CET
Goran referenced this bugreport in commit 72c34872bad6ff11cc6e74245ab5db805132c4bd

Support solarnoon and solarmidnight (bug #15771)

https://git.xfce.org/panel-plugins/xfce4-weather-plugin/commit?id=72c34872bad6ff11cc6e74245ab5db805132c4bd
Comment 3 Sean Davis editbugs 2020-03-01 05:50:43 CET
Thanks for the patch! Applied above.

Bug #15771

Reported by:
Goran
Reported on: 2019-08-02
Last modified on: 2020-03-01

People

Assignee:
Harald Judt
CC List:
2 users

Version

Attachments

Fix for polar regions (5.04 KB, patch)
2019-08-03 16:08 CEST , Goran
tiny.lasagna : review?

Additional information