1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

chore: add same date tests

This commit is contained in:
Ferdinand Mütsch
2021-04-25 20:53:17 +02:00
parent e01e6575db
commit 304fa3b03f
4 changed files with 616 additions and 476 deletions

View File

@ -66,6 +66,7 @@ func WithOffset(date time.Time, tz *time.Location) time.Time {
return time.Date(dateTz.Year(), dateTz.Month(), dateTz.Day(), dateTz.Hour(), dateTz.Minute(), dateTz.Second(), dateTz.Nanosecond(), dateTz.Location()).In(tz)
}
// SplitRangeByDays creates a slice of intervals between from and to, each of which is at max of 24 hours length and has its split at midnight
func SplitRangeByDays(from time.Time, to time.Time) [][]time.Time {
intervals := make([][]time.Time, 0)