Function relative_ahead
pub fn relative_ahead(secs_ahead: i64) -> StringExpand description
The relative style ahead: a future interval (in seconds) as a coarse
label in the host’s language: in a moment, in 3 min, in 2 hr,
tomorrow, in 4 days, in 2 weeks, in 3 months, in 1 year. Zero
and negative deltas read in a moment.
use tilo_ui::format::relative_ahead;
assert_eq!(relative_ahead(10), "in a moment");
assert_eq!(relative_ahead(180), "in 3 min");
assert_eq!(relative_ahead(3 * 86_400), "in 3 days");