#pragma once #include #if FMT_VERSION < 60000 #include #else #include #endif #include namespace waybar { struct waybar_time { std::locale locale; date::zoned_seconds ztime; }; } // namespace waybar template <> struct fmt::formatter : fmt::formatter { template auto format(const waybar::waybar_time& t, FormatContext& ctx) { #if FMT_VERSION >= 80000 auto& tm_format = specs; #endif return format_to(ctx.out(), "{}", date::format(t.locale, fmt::to_string(tm_format), t.ztime)); } };