Skip to content

[BUG] isDaytime in PropagationPanel should check local time rather than UTC #911

@alanhargreaves

Description

@alanhargreaves

Describe the Bug

In src/components/PropagationPanel.jsx we have

  const isDaytime = new Date().getUTCHours() >= 6 && new Date().getUTCHours() <= 18;

This should be based of the time of the DE station.

In addition, we actually KNOW exactly when sunrise and sunset are, we should use that information.

Going further down the rabbit hole, it appears we are displaying sunrise/sunset (at least in Dockable) in UTC rather than local time.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'BAND CONDITIONS', when day/night local does not match UTC
  2. Note that it shows daylight based on UTC

Expected Behaviour

It should be showing daylight based on the location of the DE station.

So, if we change the above javascript to use currentTime (why go and look it up again when we already have it), AND compare with deSunTimes, that should address the first issue.

The display of the sunrise/sunset in local times should "just" need a conversion to local time. We could simplify this, doing it in one place by adding a local element to deSunTimes, and do similar for dxSunTimes and use that in the display of the dx station information.

Screenshots

Image

Environment

All.


73!

Metadata

Metadata

Labels

bugSomething isn't working

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions