Skip to content

Commit

Permalink
Merge pull request getstation#399 from viktor44/hotfix/suncalc_fix
Browse files Browse the repository at this point in the history
suncalc fix
  • Loading branch information
viktor44 authored Jul 10, 2024
2 parents bff44c6 + 94aec8b commit 99fe06d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/app/src/theme/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,13 @@ export const fixSuncalc = (suncalc: SunCalc) => {
// Drop invalid values
if (typeof v !== 'number') return {};
switch (k) {
case 'nightEnd':
// Fix key name
return { dawn: v };
case 'dusk':
return { night: v };
case 'solarNoon':
return { midday: v };
case 'sunrise':
case 'sunset':
case 'night':
case 'dawn':
// Keep valid values
return { [k]: v };
default:
Expand Down

0 comments on commit 99fe06d

Please sign in to comment.