From 677cbb3384a7e30e03f19b5fc6bf3d6c19b8806b Mon Sep 17 00:00:00 2001 From: Viktar Lukashonak Date: Sat, 4 Feb 2023 23:47:44 +0300 Subject: [PATCH] When no one timezone is provided use system's TZ Signed-off-by: Viktar Lukashonak --- src/modules/clock.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index 0e1ea60..2c22721 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -32,10 +32,10 @@ waybar::modules::Clock::Clock(const std::string& id, const Json::Value& config) time_zones_.push_back(date::locate_zone(config_["timezone"].asString())); } - // If all timezones are parsed and no one is good, add nullptr to the timezones vector, to mark - // that local time should be shown. + // If all timezones are parsed and no one is good, add current time zone. nullptr in timezones + // vector means that local time should be shown if (!time_zones_.size()) { - time_zones_.push_back(nullptr); + time_zones_.push_back(date::current_zone()); } // Check if a particular placeholder is present in the tooltip format, to know what to calculate