fix: print time suffix only for relative dates

This commit is contained in:
Ondřej Pešek 2023-04-01 13:21:15 +02:00
parent c1c867a5ff
commit 8bed342a6d

View file

@ -892,11 +892,13 @@ pub fn time(created: f64) -> (String, String) {
format!("{}m", time_delta.whole_minutes()) format!("{}m", time_delta.whole_minutes())
}; };
if time_delta <= Duration::days(30) {
if OffsetDateTime::now_utc() < time { if OffsetDateTime::now_utc() < time {
rel_time += " left"; rel_time += " left";
} else { } else {
rel_time += " ago"; rel_time += " ago";
} }
}
( (
rel_time, rel_time,