Also validate dates (fixes #9)

This also simplifies things just a little bit by using e.target instead
of $(this), since that’s what we want most of the time.