fix: print time suffix only for relative dates
This commit is contained in:
parent
c1c867a5ff
commit
8bed342a6d
10
src/utils.rs
10
src/utils.rs
@ -892,10 +892,12 @@ pub fn time(created: f64) -> (String, String) {
|
|||||||
format!("{}m", time_delta.whole_minutes())
|
format!("{}m", time_delta.whole_minutes())
|
||||||
};
|
};
|
||||||
|
|
||||||
if OffsetDateTime::now_utc() < time {
|
if time_delta <= Duration::days(30) {
|
||||||
rel_time += " left";
|
if OffsetDateTime::now_utc() < time {
|
||||||
} else {
|
rel_time += " left";
|
||||||
rel_time += " ago";
|
} else {
|
||||||
|
rel_time += " ago";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(
|
(
|
||||||
|
Loading…
Reference in New Issue
Block a user