Convert strings coming from datepicker to datetime, fix error when selecting only one date refs #5215