date picker was returning a date object and not a string in YYYY-MM-DD format