Still seems to work, factor out date range render function