diff getdays
continuous-integration/drone/push Build is passing Details

master
dustoair 3 years ago
parent 9e32b2966a
commit f5463ce62a

@ -71,14 +71,14 @@ func Draw(symbol string) {
}
}
func getLastDays(len int) []string {
func getLastDays(diff int) []string {
now := time.Now()
getDay := func(t time.Time, dif int) string {
return t.AddDate(0, 0, dif).Format("01/02")
}
var res []string
for i := 1; i <= len; i++ {
res = append(res, getDay(now, i-len))
for i := 1; i <= diff; i++ {
res = append(res, getDay(now, i-diff))
}
return res
}

Loading…
Cancel
Save