Returned the length of datelist to view.html in the template