mirror of
https://github.com/sstent/go-garth.git
synced 2026-02-14 19:32:21 +00:00
porting - part 4 done
This commit is contained in:
@@ -143,3 +143,12 @@ func Min(a, b int) int {
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// DateRange generates a date range from end date backwards for n days
|
||||
func DateRange(end time.Time, days int) []time.Time {
|
||||
dates := make([]time.Time, days)
|
||||
for i := 0; i < days; i++ {
|
||||
dates[i] = end.AddDate(0, 0, -i)
|
||||
}
|
||||
return dates
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user