move date ranges out of chart functions