Display time zone according to settings

This commit is contained in:
Dan Paulat 2024-03-29 22:54:02 -05:00
parent 5fb9dc6a5f
commit d3375de968
4 changed files with 44 additions and 15 deletions

View file

@ -288,13 +288,12 @@ void OverlayLayer::Render(const QMapLibre::CustomLayerRenderParameters& params)
scwx::util::ClockFormat clockFormat = scwx::util::GetClockFormat(
settings::GeneralSettings::Instance().clock_format().GetValue());
const scwx::util::time_zone* currentZone;
auto radarProductManager = radarProductView->radar_product_manager();
#if defined(_MSC_VER)
currentZone = std::chrono::current_zone();
#else
currentZone = date::current_zone();
#endif
const scwx::util::time_zone* currentZone =
(radarProductManager != nullptr) ?
radarProductManager->default_time_zone() :
nullptr;
p->sweepTimeString_ = scwx::util::TimeString(
radarProductView->sweep_time(), clockFormat, currentZone, false);