ผมทำ datepicker แล้วให้มัน loop ออกมา แต่ช่องที่ loop ออกมา มันใส่วันที่ ไม่ได้คับ ช่วยหน่อยคับ
<script>
$(function() {
$( ".date1" ).datepicker({
dateFormat: 'yy-mm-dd',
minDate:0,
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 1,
onClose: function( selectedDate ) {
$( ".date2" ).datepicker( "option", "minDate", selectedDate );
}
});
$( ".date2" ).datepicker({
dateFormat: 'yy-mm-dd',
minDate:+1,
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 1,
onClose: function( selectedDate ) {
$( ".date1" ).datepicker( "option", "minDate", selectedDate );
}
});
});
</script>
<input class="date1" type="text" name="date1" id="date1" placeholder="Check-in" type="text" style="font-size: 14px;background-color: white; color: black;" />
<input class="date2" type="text" name="date2" id="date2" placeholder="Check-in" type="text" style="font-size: 14px;background-color: white; color: black;" />
php datepicker loop ช่วยหน่อยคับ
<script>
$(function() {
$( ".date1" ).datepicker({
dateFormat: 'yy-mm-dd',
minDate:0,
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 1,
onClose: function( selectedDate ) {
$( ".date2" ).datepicker( "option", "minDate", selectedDate );
}
});
$( ".date2" ).datepicker({
dateFormat: 'yy-mm-dd',
minDate:+1,
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 1,
onClose: function( selectedDate ) {
$( ".date1" ).datepicker( "option", "minDate", selectedDate );
}
});
});
</script>
<input class="date1" type="text" name="date1" id="date1" placeholder="Check-in" type="text" style="font-size: 14px;background-color: white; color: black;" />
<input class="date2" type="text" name="date2" id="date2" placeholder="Check-in" type="text" style="font-size: 14px;background-color: white; color: black;" />