moving ledger predictions to /ana

This commit is contained in:
Bel LaPointe
2023-10-26 10:13:22 -06:00
parent e19eb89274
commit 2bc17fccf2
5 changed files with 90 additions and 60 deletions

13
ana/window.go Normal file
View File

@@ -0,0 +1,13 @@
package ana
import "time"
func predictionTimes(window time.Duration) []time.Time {
result := []time.Time{}
last := time.Now()
for last.Before(time.Now().Add(window)) {
last = last.Add(-1 * time.Hour * 24 * time.Duration(last.Day())).Add(time.Hour * 24 * 33)
result = append(result, last)
}
return result
}