mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-13 08:19:20 +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"
|
||||
}
|
||||
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 New Issue