currentDate = new Date(currentDate);
currentDate = new Date(currentDate.getUTCFullYear(), currentDate.getUTCMonth(), currentDate.getUTCDate());
currentDate.setDate(currentDate.getDate());
+ dd = currentDate.getDate() + 1;
+ if (dd <= 9) {
+ dd = '0' + dd;
+ }
d = currentDate.getDate();
if (d <= 9) {
d = '0' + d;
}
y = currentDate.getFullYear();
start = "arrival_date=" + y + '-' + m + '-' + d + '&';
+ minDays = y + '-' + m + '-' + dd;
+ $("#departOff").attr("min", minDays);
$("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24));
if ($("#nightsOff").val() <= 0) {
$("#departOff").val("Minimum 1 Night");
$("#nightsOff").val("");
}
- stay
-
+ if ($("#departOff").val() === "Departure Date") {
+ $("#nightsOff").val("");
+ }
});
// restrict departure date ///////////////////////////////
$(document).on('change', '#departOff', function () {
currentDate = new Date(currentDate);
currentDate = new Date(currentDate.getUTCFullYear(), currentDate.getUTCMonth(), currentDate.getUTCDate());
currentDate.setDate(currentDate.getDate());
+ dd = currentDate.getDate() + 1;
+ if (dd <= 9) {
+ dd = '0' + dd;
+ }
d = currentDate.getDate();
if (d <= 9) {
d = '0' + d;
}
y = currentDate.getFullYear();
start = "arrival_date=" + y + '-' + m + '-' + d + '&';
+ minDays = y + '-' + m + '-' + dd;
+ $("#departOff").attr("min", minDays);
$("#nightsOff").val(Math.ceil(currentDate2 - currentDate) / (1000 * 60 * 60 * 24));
if ($("#nightsOff").val() <= 0) {
$("#departOff").val("Minimum 1 Night");
$("#nightsOff").val("");
}
- stay
-
+ if ($("#departOff").val() === "Departure Date") {
+ $("#nightsOff").val("");
+ }
});
// restrict departure date ///////////////////////////////
$(document).on('change', '#departOff', function () {