Skip to content

Commit

Permalink
add LocalDateRanges.String for debugging outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
its-felix committed Nov 20, 2024
1 parent e85ad77 commit db4dc7f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions go/common/xtime/range.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ func (ldrs LocalDateRanges) MarshalJSON() ([]byte, error) {
return json.Marshal(result)
}

func (ldrs LocalDateRanges) String() string {
s := ""
for d := range ldrs.Iter() {
s += d.String()
s += " "
}

if len(s) > 0 {
s = s[:len(s)-1]
}

return "[" + s + "]"
}

func (ldrs LocalDateRanges) Contains(d LocalDate) bool {
return LocalDateBitSet(ldrs).Contains(d)
}
Expand Down

0 comments on commit db4dc7f

Please sign in to comment.