mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Fix working without timezone
This commit is contained in:
parent
d8bc6c92bb
commit
c5e4d26320
@ -29,13 +29,8 @@ waybar::modules::Clock::Clock(const std::string& id, const Json::Value& config)
|
|||||||
zone_name.asString()
|
zone_name.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.
|
} else if (config_["timezone"].isString() && !config_["timezone"].asString().empty()) {
|
||||||
if (!time_zones_.size()) {
|
|
||||||
time_zones_.push_back(nullptr);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
time_zones_.push_back(
|
time_zones_.push_back(
|
||||||
date::locate_zone(
|
date::locate_zone(
|
||||||
config_["timezone"].asString()
|
config_["timezone"].asString()
|
||||||
@ -43,6 +38,11 @@ waybar::modules::Clock::Clock(const std::string& id, const Json::Value& config)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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 (!time_zones_.size()) {
|
||||||
|
time_zones_.push_back(nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_timezone_fixed()) {
|
if (!is_timezone_fixed()) {
|
||||||
spdlog::warn("As using a timezone, some format args may be missing as the date library haven't got a release since 2018.");
|
spdlog::warn("As using a timezone, some format args may be missing as the date library haven't got a release since 2018.");
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ auto waybar::modules::Clock::update() -> void {
|
|||||||
calendar_lines = calendar_text(wtime);
|
calendar_lines = calendar_text(wtime);
|
||||||
}
|
}
|
||||||
auto tooltip_format = config_["tooltip-format"].asString();
|
auto tooltip_format = config_["tooltip-format"].asString();
|
||||||
text = fmt::format(tooltip_format, wtime, fmt::arg("calendar", calendar_lines));
|
text = fmt::format(tooltip_format, wtime, fmt::arg(kCalendarPlaceholder.c_str(), calendar_lines));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user