Skip to main content
add more lines
Source Link
anpsmn
  • 7.3k
  • 2
  • 31
  • 44

You need to check if the selected date is less than and not greater than the checkout date.

 if (ev.date.valueOf() < checkout.date.valueOf()) { 

And onRender method for checkout you were checking if the date is ahead of today and before checkin date which can never be true. You should check the case where it's between the checkin date and today. Hope this is what you wanted.

onRender: function (date) { return (date.valueOf() < now.valueOf()) && (date.valueOf()>= checkin.date.valueOf()) ? '' : 'disabled'; } 

Demo fiddle

You need to check if the selected date is less than and not greater than the checkout date.

 if (ev.date.valueOf() < checkout.date.valueOf()) { 

And onRender method for checkout

onRender: function (date) { return (date.valueOf() < now.valueOf()) && (date.valueOf()>= checkin.date.valueOf()) ? '' : 'disabled'; } 

Demo fiddle

You need to check if the selected date is less than and not greater than the checkout date.

 if (ev.date.valueOf() < checkout.date.valueOf()) { 

And onRender method for checkout you were checking if the date is ahead of today and before checkin date which can never be true. You should check the case where it's between the checkin date and today. Hope this is what you wanted.

onRender: function (date) { return (date.valueOf() < now.valueOf()) && (date.valueOf()>= checkin.date.valueOf()) ? '' : 'disabled'; } 

Demo fiddle

Source Link
anpsmn
  • 7.3k
  • 2
  • 31
  • 44

You need to check if the selected date is less than and not greater than the checkout date.

 if (ev.date.valueOf() < checkout.date.valueOf()) { 

And onRender method for checkout

onRender: function (date) { return (date.valueOf() < now.valueOf()) && (date.valueOf()>= checkin.date.valueOf()) ? '' : 'disabled'; } 

Demo fiddle