Is this what you're after?
<script>
function getLastSunday() {
var sun = new Date();
sun.setDate(sun.getDate() - sun.getDay());
return sun;
}
$(function() { $( "#datepicker" ).datepicker({ dateFormat: 'dd-mm-yy', defaultDate: getLastSunday() }); });
</script>
The currentText option that you mentioned only specifies the text shown on a button that links to the current day that is only shown if the showButtonPanel option is set to true.
defaultDate, as shown in my code, sets the date that is selected by default when the datepicker is opened.
Alternatively, if you want to actually set the value of the input box, include the getLastSunday() function then use
$(function() {
$( "#datepicker" ).datepicker({
dateFormat: 'dd-mm-yy',
});
$("#datepicker").datepicker('setDate', getLastSunday());
});
I've made a jsfiddle here
Basic algorithm taken from: http://forum.jquery.com/topic/datepicker-default-date-set-to-last-week