Slightly improved format of mute time in menu.

This commit is contained in:
23rd 2022-05-02 20:52:40 +03:00
parent 1349989494
commit 4125a45503
1 changed files with 7 additions and 5 deletions

View File

@ -420,14 +420,16 @@ QString FormatMuteForTiny(float64 sec) {
return (sec <= 60) return (sec <= 60)
? QString() ? QString()
: (sec <= 60 * 59) : (sec <= 60 * 59)
? tr::lng_minutes_tiny(tr::now, lt_count, int(sec / 60)) ? tr::lng_minutes_tiny(tr::now, lt_count, std::round(sec / 60))
: (sec <= 3600 * 23) : (sec <= 3600 * 23)
? tr::lng_hours_tiny(tr::now, lt_count, int(sec / 3600)) ? tr::lng_hours_tiny(tr::now, lt_count, std::round(sec / 3600))
: (sec <= 86400 * 6) : (sec <= 86400 * 6)
? tr::lng_days_tiny(tr::now, lt_count, int(sec / 86400)) ? tr::lng_days_tiny(tr::now, lt_count, std::round(sec / 86400))
: (sec <= (86400 * 7) * 3) : (sec <= (86400 * 7) * 3)
? tr::lng_weeks_tiny(tr::now, lt_count, int(sec / (86400 * 7))) ? tr::lng_weeks_tiny(tr::now, lt_count, std::round(sec / (86400 * 7)))
: QString(); : (sec <= (86400 * 31) * 11)
? tr::lng_months_tiny({}, lt_count, std::round(sec / (86400 * 31)))
: tr::lng_years_tiny({}, lt_count, std::round(sec / (86400 * 365)));
} }
} // namespace Ui } // namespace Ui