Added the date picker code and added some validations