diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index c74207b3..47ea3dbb 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -1663,8 +1663,10 @@ template struct formatter { auto format(weekday wd, FormatContext& ctx) const -> decltype(ctx.out()) { auto time = std::tm(); time.tm_wday = static_cast(wd.c_encoding()); - return detail::write( - ctx.out(), time, detail::get_locale(localized, ctx.locale()), 'a'); + detail::get_locale loc(localized, ctx.locale()); + auto w = detail::tm_writer(loc, ctx.out(), time); + w.on_abbr_weekday(); + return w.out(); } };