def period_dates(period):
 end = (date.today() - timedelta(days=1))
 if (period == LAST_7_DAYS):
  start = (end - timedelta(days=7))
 elif (period == LAST_30_DAYS):
  start = (end - timedelta(days=30))
 elif (period == LAST_90_DAYS):
  start = (end - timedelta(days=90))
 elif ALL_TIME:
  start = settings.GA_START_DATE
 return (start, end)

def period_dates ( period ) : end = ( date . today ( ) - timedelta ( days = 1 ) ) if ( period == LAST_7_DAYS ) : start = ( end - timedelta ( days = 7 ) ) elif ( period == LAST_30_DAYS ) : start = ( end - timedelta ( days = 30 ) ) elif ( period == LAST_90_DAYS ) : start = ( end - timedelta ( days = 90 ) ) elif ALL_TIME : start = settings . GA_START_DATE return ( start , end )
return when each period begins and ends .