It might be possible that your code is being run after the datepicker is already initialized. You should be able to pass the dateFormat: "yy-mm-dd"
option in wherever your datepicker is being initialized in your JavaScript.
You should be able to update the dateFormat after it's been initialized (based on these docs) like this:
// Setter
$(".selector").datepicker("option", "dateFormat", "yy-mm-dd");
.selector
is most likely .datepicker
in your case unless you've changed it (going of the examples here).
Also, you should be able to see what the date format is set to like this:
console.log("dateFormat:", $(".selector").datepicker("option", "dateFormat"));