1
I have 2 datapickers, as I do to show only that day I stored?
code:
$("#data-retorno").datepicker({
dateFormat: 'dd/mm/yy',
dayNames: ['Domingo','Segunda','Terça','Quarta','Quinta','Sexta','Sábado','Domingo'],
dayNamesMin: ['D','S','T','Q','Q','S','S','D'],
dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb','Dom'],
monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
beforeShowDay: function (date) {
return [date.getDay() == 5, ""]
},
onClose: function(selectedDate) {
var data = $.datepicker.parseDate('dd/mm/yy', selectedDate);
data.setDate(data.getDate('dd/mm/yy') + 1);
alert(data);
$("#data-checkout").datepicker("option", "minDate", data);
}
});
In the case in this script, the date selected, it will add up to 1 day,now, as if return only that day in the script below?
$("#data-checkout").datepicker({
dateFormat: 'dd/mm/yy',
dayNames: ['Domingo','Segunda','Terça','Quarta','Quinta','Sexta','Sábado','Domingo'],
dayNamesMin: ['D','S','T','Q','Q','S','S','D'],
dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb','Dom'],
monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
beforeShowDay: function (date) {
return [date.getDay() == 6, ""]
}
});
});
Sorry, I don’t understand your doubt...
– Rafael Withoeft
In this variable
var data = $.datepicker.parseDate('dd/mm/yy', selectedDate);
I store a selected day. And I pass this value to datapicker #data-checkout, only in it, I Seto minDate, causing, return Saturdays from that date, only that I do not want you to return from the date, I want to return only the date. If the guy clicks 14 will add up + 1 getting 15; I do not want him to return from 15, and yes, only the 15.– Michel Henriq
Try to inform the
minDate
andmaxDate
equal. That is, the two with the same date, in your example it would be the day 15. In your case, it would be only add maxDate inonClose: $("#data-checkout").datepicker("option", "maxDate", data);
– Rafael Withoeft
Thanks ! worked out !
– Michel Henriq