func YesterdayRange() DateRange {
	now := now.New(Now())
	start := now.BeginningOfDay().AddDate(0, 0, -1)
	end := start.AddDate(0, 0, 1).Add(-time.Nanosecond)
	return DateRange{Start: start, End: end}
}
YesterdayRange returns a date range for yesterday
package util
import (
	"fmt"
	"time"
	"github.com/jinzhu/now"
)
var Now = func() time.Time { return time.Now() }
type DateRange struct {
	Start time.Time
	End   time.Time
}
func (d DateRange) IsSet() bool {
	return !d.Start.IsZero() || !d.End.IsZero()
}
func (d DateRange) String() string {
	return fmt.Sprintf("%s - %s", d.Start.Format(time.UnixDate), d.End.Format(time.UnixDate))
}
func (d DateRange) Within(t time.Time) bool {
	switch {
	case !d.Start.IsZero() && !d.End.IsZero():
		return t.Equal(d.Start) || t.Equal(d.End) || (t.After(d.Start) && t.Before(d.End))
	case !d.Start.IsZero():
		return t.Equal(d.Start) || t.After(d.Start)
	case !d.End.IsZero():
		return t.Equal(d.End) || t.Before(d.End)
	default:
		return false
	}
}
func AfterNow(n int) DateRange {
	end := now.New(Now()).EndOfDay().AddDate(0, 0, -n)
	return DateRange{End: end}
}
func TodayRange() DateRange {
	now := now.New(Now())
	start := now.BeginningOfDay()
	end := now.EndOfDay()
	return DateRange{Start: start, End: end}
}