28 if (seconds % SecondsPerWeek == 0 && seconds >= SecondsPerWeek)
30 int64_t w = seconds / SecondsPerWeek;
31 return std::format(
"{} week{}", w, w > 1 ?
"s" :
"");
33 if (seconds % SecondsPerDay == 0 && seconds >= SecondsPerDay)
35 int64_t d = seconds / SecondsPerDay;
36 return std::format(
"{} day{}", d, d > 1 ?
"s" :
"");
38 if (seconds % SecondsPerHour == 0 && seconds >= SecondsPerHour)
40 int64_t h = seconds / SecondsPerHour;
41 return std::format(
"{} hour{}", h, h > 1 ?
"s" :
"");
43 if (seconds % SecondsPerMinute == 0 && seconds >= SecondsPerMinute)
45 int64_t m = seconds / SecondsPerMinute;
46 return std::format(
"{} minute{}", m, m > 1 ?
"s" :
"");
48 return std::format(
"{} second{}", seconds, seconds > 1 ?
"s" :
"");
79 std::string_view expiresInPrefix)
83 return std::string(permanentText);
86 int64_t remaining = expiresAt - nowSec;
89 return std::string(permanentText);
92 return std::format(
"{} {}", expiresInPrefix,
FormatDuration(remaining));