change date UI control and fix datatype problem on rails