func TimeframeFromQuery(params url.Values) (Timeframe, error) {
	from := params.Get("from")
	to := params.Get("to")
	if from == "" || to == "" {
		return Timeframe{}, fmt.Errorf("'from' and/or 'to' must be set")
	}
	startTime, err1 := time.Parse("20060102", from)
	startDate := ShortDate{startTime}
	endTime, err2 := time.Parse("20060102", to)
	endDate := ShortDate{endTime}
	if err1 != nil || err2 != nil {
		return Timeframe{}, fmt.Errorf("Malformed query params")
	}
	return Timeframe{StartDate: startDate, EndDate: endDate}, nil
}
// TimeframeFromQuery parses a timeframe from a query. The param keys are
// expected to be `from` for the StartDate and `to` for the EndDate
TimeframeFromQuery parses a timeframe from a query. The param keys are
expected to be `from` for the StartDate and `to` for the EndDate
// TimeframeFromQuery parses a timeframe from a query . The param keys are // expected to be ` from ` for the StartDate and ` to ` for the EndDate
func TimeframeFromQuery(params url.Values) (Timeframe, error) {
	from := params.Get("from")
	to := params.Get("to")
	if from == "" || to == "" {
		return Timeframe{}, fmt.Errorf("'from' and/or 'to' must be set")
	}
	startTime, err1 := time.Parse("20060102", from)
	startDate := ShortDate{startTime}
	endTime, err2 := time.Parse("20060102", to)
	endDate := ShortDate{endTime}
	if err1 != nil || err2 != nil {
		return Timeframe{}, fmt.Errorf("Malformed query params")
	}
	return Timeframe{StartDate: startDate, EndDate: endDate}, nil
}
func TimeframeFromQuery ( params url . Values ) ( Timeframe , error ) { from := params . Get ( " " ) to := params . Get ( " " ) if from == " " || to == " " { return Timeframe { } , fmt . Errorf ( " " ) } startTime , err1 := time . Parse ( " " , from ) startDate := ShortDate { startTime } endTime , err2 := time . Parse ( " " , to ) endDate := ShortDate { endTime } if err1 != nil || err2 != nil { return Timeframe { } , fmt . Errorf ( " " ) } return Timeframe { StartDate : startDate , EndDate : endDate } , nil }
TimeframeFromQuery parses a timeframe from a query.
TimeframeFromQuery parses a timeframe from a query .