From d1a8724296f380fffc3f566617b3e321115c72ac Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 16 Aug 2022 13:17:55 -0700 Subject: [PATCH] ircd: Use fmt flags to ago(); add flag for blank postfix label. --- ircd/timedate.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ircd/timedate.cc b/ircd/timedate.cc index 9ed97c672..b1d8668dd 100644 --- a/ircd/timedate.cc +++ b/ircd/timedate.cc @@ -96,8 +96,9 @@ ircd::ago(const mutable_buffer &buf, char tmp[64]; return fmt::sprintf { - buf, "%s ago", - pretty(tmp, diff, fmt), + buf, "%s%s", + pretty(tmp, diff, fmt & 0x01), + (fmt & 0x2)? string_view{}: " ago"_sv, }; }