fix the insane limits of laterthan, max year 1000 makes it useless. Redmine #6530.
Merge pull request #1909 from estenberg/bugfix/laterthan

laterthan fix and acceptance tests