func (tf *Timeframe) UnmarshalJSON(data []byte) error {
	unquotedData, _ := strconv.Unquote(string(data))
	dates := strings.Split(unquotedData, ",")
	if len(dates) != 2 {
		*tf = Timeframe{}
		return nil
	}
	startTime, err1 := time.Parse("2006-01-02", dates[0])
	startDate := ShortDate{startTime}
	endTime, err2 := time.Parse("2006-01-02", dates[1])
	endDate := ShortDate{endTime}
	if err1 != nil || err2 != nil {
		*tf = Timeframe{}
		return nil
	}
	*tf = Timeframe{StartDate: startDate, EndDate: endDate}
	return nil
}
// UnmarshalJSON unmarshals data into a timeframe
UnmarshalJSON unmarshals data into a timeframe
// UnmarshalJSON unmarshals data into a timeframe
func (tf *Timeframe) UnmarshalJSON(data []byte) error {
	unquotedData, _ := strconv.Unquote(string(data))
	dates := strings.Split(unquotedData, ",")
	if len(dates) != 2 {
		*tf = Timeframe{}
		return nil
	}
	startTime, err1 := time.Parse("2006-01-02", dates[0])
	startDate := ShortDate{startTime}
	endTime, err2 := time.Parse("2006-01-02", dates[1])
	endDate := ShortDate{endTime}
	if err1 != nil || err2 != nil {
		*tf = Timeframe{}
		return nil
	}
	*tf = Timeframe{StartDate: startDate, EndDate: endDate}
	return nil
}
func ( tf * Timeframe ) UnmarshalJSON ( data [ ] byte ) error { unquotedData , _ := strconv . Unquote ( string ( data ) ) dates := strings . Split ( unquotedData , " " ) if len ( dates ) != 2 { * tf = Timeframe { } return nil } startTime , err1 := time . Parse ( " " , dates [ 0 ] ) startDate := ShortDate { startTime } endTime , err2 := time . Parse ( " " , dates [ 1 ] ) endDate := ShortDate { endTime } if err1 != nil || err2 != nil { * tf = Timeframe { } return nil } * tf = Timeframe { StartDate : startDate , EndDate : endDate } return nil }
UnmarshalJSON unmarshals data into a timeframe
UnmarshalJSON unmarshals data into a timeframe