Si queremos desactivar en el calendario los días del fin de semana, sábado y domingo, tenemos que incluir este script en el head de nuestro página web:
$(function() { $('#txtDate').datepicker({ beforeShowDay: $.datepicker.noWeekends }); });
Aplicando esté código tendríamos lo siguiente:
Aquí está todo el código completo para que funcione en un archivo html:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Datepicker - Default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(function() { $( "#datepicker" ).datepicker(); }); </script> <script> $(function() { $('#txtDate').datepicker({ beforeShowDay: $.datepicker.noWeekends }); }); </script> </head> <body> Fecha: <input type='text' id='txtDate' /> </body> </html>