Improve date validator

Avoid inline comments.