Improved date setting check
Merge pull request #308 from stefk/date-check

Improved date setting check