Skip to content

Commit

Permalink
fixed 24-hour format not working for sunrise/sunset (amit9838#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainloreley committed Jun 15, 2024
1 parent 39a7d0d commit 96217e0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/frontendCardDayNight.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,15 @@ def get_sunset_sunrise_degree(self):
sunset_ts = daily_data.sunset.get("data")[i]
break

sunrise = datetime.fromtimestamp(sunrise_ts - time_diff).strftime("%I:%M %p")
sunset = datetime.fromtimestamp(sunset_ts - time_diff).strftime("%I:%M %p")
sunrise_dt = datetime.fromtimestamp(sunrise_ts - time_diff)
sunset_dt = datetime.fromtimestamp(sunset_ts - time_diff)

sunrise = sunrise_dt.strftime("%I:%M %p")
sunset = sunset_dt.strftime("%I:%M %p")

if settings.is_using_24h_clock:
sunrise = sunrise_dt.strftime("%H:%M")
sunset = sunset_dt.strftime("%H:%M")

# Caclulate Sun rotation
degree = 0
Expand Down

0 comments on commit 96217e0

Please sign in to comment.