Logical eror - should be or, not and
Still seems to work, factor out date range render function