I'm using Bootstrap datepicker. The answer is probably obvious, but I can't figure out how to get the selected date as a string in the specified format. I used:
<div id="myDate" data-date-format="yyyy-mm-dd">
<input type="text">
</div>
And in my javascript:
var value = $("#myDate").datepicker("getDate");
But it returns a date, not a string in yyyy-mm-dd format.