minDays = $('#dateOff1').attr("min");
$("#dateOff1").val(minDays);
$("#dateOff2").val($('#dateOff2').attr("min"));
- } else {
- d = currentDate.getDate() + 2;
- if (d <= 9) {
- d = '0' + d;
- }
- m = currentDate.getMonth() + 1;
- if (m <= 9) {
- m = '0' + m;
- }
- y = currentDate.getFullYear();
- requiredDate = y + '-' + m + '-' + d;
- $("#dateOff2").val(requiredDate);
+ }else{
+ d = currentDate.getDate() + 2;
+ if (d <= 9) {
+ d = '0' + d;
+ }
+ m = currentDate.getMonth() + 1;
+ if (m <= 9) {
+ m = '0' + m;
+ }
+ y = currentDate.getFullYear();
+ requiredDate = y + '-' + m + '-' + d;
+ $("#dateOff2").val(requiredDate);
}
+
});
// restrict departure date ///////////////////////////////
$(document).on('change', '#dateOff2', function () {
minDays = $('#dateOff1').attr("min");
$("#dateOff1").val(minDays);
$("#dateOff2").val($('#dateOff2').attr("min"));
- } else {
- d = currentDate.getDate() + 2;
- if (d <= 9) {
- d = '0' + d;
- }
- m = currentDate.getMonth() + 1;
- if (m <= 9) {
- m = '0' + m;
- }
- y = currentDate.getFullYear();
- requiredDate = y + '-' + m + '-' + d;
- $("#dateOff2").val(requiredDate);
+ }else{
+ d = currentDate.getDate() + 2;
+ if (d <= 9) {
+ d = '0' + d;
+ }
+ m = currentDate.getMonth() + 1;
+ if (m <= 9) {
+ m = '0' + m;
+ }
+ y = currentDate.getFullYear();
+ requiredDate = y + '-' + m + '-' + d;
+ $("#dateOff2").val(requiredDate);
}
+
});
// restrict departure date ///////////////////////////////
$(document).on('change', '#dateOff2', function () {