fixes #47 Disallow invalid date ranges