Completed functionality of date picker