2017-10-06 15 views
0
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); 
     } 

    } 

Ich möchte die Buchung im Monat Juli und August nur Buchung von 7,14,21 Tage und auch Buchung Pickday muss Samstag sein. Ich verwende ein Miet- und Buchungs-Plugin. Es funktioniert gut für den Monat Juli und August, was ich will, aber nicht für den Tag woking. Ich möchte auch Buchungstag muss Samstag sein. Bitte jede Hilfe.Blockbuchung für bestimmte Tage und Monate

danke im voraus.

+0

habe ich die Lösung –

+0

if (pickmonth == 6 || pickmonth == 7) { \t \t \t \t \t \t \t \t \t if ((parseInt (Tage)> parseInt (0) && parseInt (Tage) parseInt (7) && parseInt (Tage) parseInt (14) && parseInt (Tage)

+0

bitte einen Kommentar abzugeben als Antwort, wie dies in readble Format willl – Pritamkumar

Antwort

0
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); 
     } 

     } 

So habe ich unsere Lösung bekommen.

+0

Es funktioniert für mich. –

Verwandte Themen