Function relative_compact
pub fn relative_compact(secs_ago: i64) -> StringExpand description
The relative style for list columns too tight for relative’s
wording: now, 3m, 2h, 4d, 2w, 3mo, 1y. Zero and negative
deltas (clock skew) read now.
use tilo_ui::format::relative_compact;
assert_eq!(relative_compact(30), "now");
assert_eq!(relative_compact(180), "3m");
assert_eq!(relative_compact(3 * 3600), "3h");
assert_eq!(relative_compact(2 * 86_400), "2d");