mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-29 16:31:18 +00:00
fix lowercase "m" for "month", make it uppercase. also add "w" for up to 7 weeks.
This commit is contained in:
parent
0b51467ffa
commit
d39959d2a6
@ -20,12 +20,12 @@ pub fn date_ago(then: Unixtime) -> String {
|
||||
format!("{}h", hours as i64)
|
||||
} else if hours < 42.0 {
|
||||
"1d".to_string()
|
||||
} else if days < 30.0 {
|
||||
} else if days < 14.0 {
|
||||
format!("{}d", days as i64)
|
||||
} else if days < 45.0 {
|
||||
"1m".to_string()
|
||||
} else if days < 56.0 {
|
||||
format!("{}w", (days / 7.0) as i64)
|
||||
} else if days < 365.0 {
|
||||
format!("{}m", (days / 30.0) as i64)
|
||||
format!("{}M", (days / 30.0) as i64)
|
||||
} else if years < 1.5 {
|
||||
"1y".to_string()
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user