To disable weekends (Saturdays and Sundays) in jQuery UI Datepicker, you can use the beforeShowDay option to specify the selectable dates. Here's the precise solution:
$(function() {
    $("#datepicker").datepicker({
        beforeShowDay: function(date) {
            // day 0 = Sunday, day 6 = Saturday
            return [date.getDay() !== 0 && date.getDay() !== 6, ''];
        }
    });
});