fix errors in date handling