// Validated returns a query with Timestamp fixed
Validated returns a query with Timestamp fixed
// Validated returns a query with Timestamp fixed
func (q Query) Validated() (n Query) {
	n = q
	if n.Timestamp.Beginning.IsZero() {
		n.Timestamp.Beginning = BeginningOfDay()
	}
	if n.Timestamp.End.IsZero() {
		n.Timestamp.End = EndOfDay()
	}
	if n.Timestamp.End.Before(n.Timestamp.Beginning) || !SameDay(n.Timestamp.Beginning, n.Timestamp.End) {
		n.Timestamp.End = EndOfTheDay(n.Timestamp.Beginning)
	}
	if n.Skip < 0 {
		n.Skip = 0
	}
	return
}
func ( q Query ) Validated ( ) ( n Query ) { n = q if n . Timestamp . Beginning . IsZero ( ) { n . Timestamp . Beginning = BeginningOfDay ( ) } if n . Timestamp . End . IsZero ( ) { n . Timestamp . End = EndOfDay ( ) } if n . Timestamp . End . Before ( n . Timestamp . Beginning ) || ! SameDay ( n . Timestamp . Beginning , n . Timestamp . End ) { n . Timestamp . End = EndOfTheDay ( n . Timestamp . Beginning ) } if n . Skip < 0 { n . Skip = 0 } return }
Validated returns a query with Timestamp fixed
Validated returns a query with Timestamp fixed
// assign n with q // assign Beginning as beginning of today if missing // assign End as end of today if missing // change End to end of the day of Beginning if End is not same date with Beginning or End is before Beginning // fix offset