Add a function for control input date