Fix display issue with datepicker persisting on page load

Fixes #568

@lukecarbis Please review