0
votes
    var pickmonth = Date.parse(pickupDate).getMonth();
    var pickday = Date.parse(pickupDate).getDay();

    if (pickday < 6 &&(pickmonth == 6 || pickmonth == 7)){

       if((parseInt(days) > parseInt(0) && parseInt(days) < parseInt(7)) ||(parseInt(days) > parseInt(7) && parseInt(days) < parseInt(14)) || (parseInt(days) > parseInt(14) && parseInt(days) < parseInt(21))){

           alert ('Hi');
           error.push(translated_strings.min_booking_days + '7,14 & 21 and checkin day must be saturday' + min_rental_days);
       }

    }

I want the booking in month of july and august only booking of 7,14,21 days and also booking pickday must be saturday. I am using rental and booking plugin. Its working fine for month of july and august what i want but not woking for day. I also want booking day must be saturday. Please any help.

thanks in advance.

1
I got the solutionAvinash Gupta
if (pickmonth == 6 || pickmonth == 7){ if((parseInt(days) > parseInt(0) && parseInt(days) < parseInt(7)) ||(parseInt(days) > parseInt(7) && parseInt(days) < parseInt(14)) || (parseInt(days) > parseInt(14) && parseInt(days) < parseInt(21))){ error.push(translated_strings.min_booking_days + '7,14 & 21 and checkin day must be saturday' + min_rental_days); } if (pickday < 6){ error.push(translated_strings.min_booking_days + '7,14 & 21 and checkin day must be saturday' + min_rental_days); } }Avinash Gupta
please post your comment as answer as this willl be in readble formatPritamkumar

1 Answers

0
votes
var pickmonth = Date.parse(pickupDate).getMonth();
                        var pickday = Date.parse(pickupDate).getDay();

        if (pickmonth == 6 || pickmonth == 7){


        if((parseInt(days) > parseInt(0) && parseInt(days) < parseInt(7)) ||(parseInt(days) > parseInt(7) && parseInt(days) < parseInt(14)) || (parseInt(days) > parseInt(14) && parseInt(days) < parseInt(21))){

            error.push(translated_strings.min_booking_days + '7,14 & 21 and checkin day must be saturday' + min_rental_days);
        }

        if (pickday < 6){
            error.push(translated_strings.min_booking_days + '7,14 & 21 and checkin day must be saturday' + min_rental_days);
        }

        }

This way i got our solution.