improve date handling; use correct date string based on requested input type