pub fn time_ago(seconds: u64) -> String {
    let minutes: f32 = seconds as f32 / 60.0;
    let hours: f32 = minutes / 60.0;
    let days: f32 = hours / 24.0;
    let years: f32 = days / 365.0;

    if seconds < 45 {
        format!("{} seconds", seconds)
    } else if seconds < 90 {
        "1 minute".to_string()
    } else if minutes < 45.0 {
        format!("{} minutes", minutes as i64)
    } else if minutes < 90.0 {
        "1 hour".to_string()
    } else if hours < 24.0 {
        format!("{} hours", hours as i64)
    } else if hours < 42.0 {
        "1 day".to_string()
    } else if days < 14.0 {
        format!("{} days", days as i64)
    } else if days < 56.0 {
        format!("{} weeks", (days / 7.0) as i64)
    } else if days < 365.0 {
        format!("{} months", (days / 30.0) as i64)
    } else if years < 1.5 {
        "1 year".to_string()
    } else {
        format!("{} years", years as i64)
    }
}
