2
I have an input on my system that receives a date selected by the user, I would like to know how I can check if this date is a weekend.
my input works that way:
<input type="text" class="form-control" id="data" name="data" placeholder="Data" required>
$( function() {
$( "#data" ).datepicker({showAnim: "slideDown", dateFormat: 'dd/mm/yy' , autoSize: true ,maxDate: "0" , minDate: "-2m",
dayNamesMin: [ "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab" ],
dayNamesShort: [ "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab" ],
monthNamesShort: [ "Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez" ],
monthNames: [ "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]});
$("#data").on("change",function(){
var selected = $(this).val();
Edit(selected);});
} );
If the intention is to block the selection of days on weekends, its component
datepicker
you will surely have an option.– Roberto Braga