calculate the past 7 days