Added functionality to display the datepicker above the input field if the bottom of the datepicker would be below the window