mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-22 04:39:21 +02:00
Update time duration calculation
This commit is contained in:
parent
79d4ff4b08
commit
c753a74f49
|
@ -80,19 +80,19 @@ func DurToStr(dur time.Duration) string {
|
||||||
return strconv.Itoa(int(s)) + "s"
|
return strconv.Itoa(int(s)) + "s"
|
||||||
}
|
}
|
||||||
m := dur.Minutes()
|
m := dur.Minutes()
|
||||||
if m < 60 {
|
if m < 60*2 {
|
||||||
return strconv.Itoa(int(m)) + "m"
|
return strconv.Itoa(int(m)) + "m"
|
||||||
}
|
}
|
||||||
h := dur.Hours()
|
h := dur.Hours()
|
||||||
if h < 24 {
|
if h < 24*2 {
|
||||||
return strconv.Itoa(int(h)) + "h"
|
return strconv.Itoa(int(h)) + "h"
|
||||||
}
|
}
|
||||||
d := h / 24
|
d := h / 24
|
||||||
if d < 30 {
|
if d < 30*2 {
|
||||||
return strconv.Itoa(int(d)) + "d"
|
return strconv.Itoa(int(d)) + "d"
|
||||||
}
|
}
|
||||||
mo := d / 30
|
mo := d / 30
|
||||||
if mo < 12 {
|
if mo < 12*2 {
|
||||||
return strconv.Itoa(int(mo)) + "mo"
|
return strconv.Itoa(int(mo)) + "mo"
|
||||||
}
|
}
|
||||||
y := mo / 12
|
y := mo / 12
|
||||||
|
|
Loading…
Reference in New Issue