I have a variable and inside of it is a date in which i get it from my database and I just want to ask how to use it in my datepicker using minDate and maxDate here is my code:
<?php
include ('connection.php');
$count = 1;
$query = "SELECT * FROM tblPaymentDetails WHERE CustomerID = '$count'";
$run = mysqli_query($con, $query);
if(mysqli_num_rows($run)>= 1){
$row = mysqli_fetch_assoc($run);
$CheckInDate = "$row[CheckInDate]";
$CheckOutDate = "$row[CheckOutDate]";
}
else{
echo"error";
}
?>
<script> $(function() {
$( "#txtCheckOutDate" ).datepicker({ minDate: new Date($CheckInDate), maxDate: new Date($CheckOutDate)});
});
</script>