efactoring date input