fix: type

This commit is contained in:
Alex 2020-05-22 18:56:32 +02:00
parent cef5b27b48
commit a871dcaebe
1 changed files with 3 additions and 2 deletions

View File

@ -43,14 +43,15 @@ auto waybar::modules::Clock::update() -> void {
waybar_time wtime = {locale_,
date::make_zoned(time_zone_, date::floor<std::chrono::seconds>(now))};
std::string text;
if (!fixed_time_zone_) {
// As date dep is not fully compatible, prefer fmt
tzset();
auto localtime = fmt::localtime(std::chrono::system_clock::to_time_t(now));
auto text = fmt::format(format_, localtime);
text = fmt::format(format_, localtime);
label_.set_markup(text);
} else {
auto text = fmt::format(format_, wtime);
text = fmt::format(format_, wtime);
label_.set_markup(text);
}