improve input date handling