Correctly setDate in datepicker