Fix datepicker to send data in correct format