Fixed some datepicker bugs