mirror of
https://git.freesoftwareextremist.com/bloat
synced 2024-12-22 09:10:42 +00:00
Update time duration calculation
This commit is contained in:
parent
79d4ff4b08
commit
c753a74f49
1 changed files with 4 additions and 4 deletions
|
@ -80,19 +80,19 @@ func DurToStr(dur time.Duration) string {
|
|||
return strconv.Itoa(int(s)) + "s"
|
||||
}
|
||||
m := dur.Minutes()
|
||||
if m < 60 {
|
||||
if m < 60*2 {
|
||||
return strconv.Itoa(int(m)) + "m"
|
||||
}
|
||||
h := dur.Hours()
|
||||
if h < 24 {
|
||||
if h < 24*2 {
|
||||
return strconv.Itoa(int(h)) + "h"
|
||||
}
|
||||
d := h / 24
|
||||
if d < 30 {
|
||||
if d < 30*2 {
|
||||
return strconv.Itoa(int(d)) + "d"
|
||||
}
|
||||
mo := d / 30
|
||||
if mo < 12 {
|
||||
if mo < 12*2 {
|
||||
return strconv.Itoa(int(mo)) + "mo"
|
||||
}
|
||||
y := mo / 12
|
||||
|
|
Loading…
Reference in a new issue