Show the next available slot

We want to show the next available slots to our customers, without having them to paginate the calendar for weeks

So now they see an empty week and have to paginate forward.

But we would want to them to see this right away:

I know we can hotlink to the right week in the iframe directly via:

Driftcarts ErwachsenejumpDate=2022-04-25

But this date obviously always changes. Is there a way to just link to the next available event? THat would save us a lot of pain. Otherwise we need to calculate which event happens next and then change the link in the iframe dynamically.

Cheers and thx for your help
Thomas

2 Likes

@plotti welcome to the Forum Thomas. We are working on building out this feature. I am not 100% on what form it will take on only presenting your availability regardless how far in advance it is, or provide a button for bookers to choose the next available date. When we have this flushed out more I will update you. In the interim as you mentioned the jump to date option is the best, or you could use the fixed start date too. But you would have to change this periodically.

1 Like

This feature would be very welcome

This would be a handy feature.

Here is an idea I ended up implementing
I am embedding the calendar directly on the page. I have events always every 2 weeks. The js code picks the right week based on the actual date.

<!-- change the booking calendar to a week thats always available -->
<script>
function nextevent(input){
  var now = new Date();
  console.log(now.toISOString())
    var oneJan = new Date(now.getFullYear(),0,1);
    var numberOfDays = Math.floor((now - oneJan) / (24 * 60 * 60 * 1000));
    var weekNumber = Math.ceil(( now.getDay() + 1 + numberOfDays) / 7)-1;
    console.log(weekNumber)
    if (weekNumber %2 == 0){
    now.setDate(now.getDate() + (0 + 7 - now.getDay()) % 7+2);
    console.log("even" + now)
    }
  else{
    now.setDate(now.getDate() + (0 + 7 - now.getDay()) % 7-5);
    console.log("uneven"+now)
}
  return(input+now.toISOString().slice(0,10));
 }
   document.addEventListener("DOMContentLoaded", function(event) {
    document.getElementById("adultbooking").setAttribute("src", nextevent("https://driftcarts.youcanbook.me/service/jsps/cal.jsp?cal=d2370ff9-256e-4da3-91c3-f9f3ab786b9d&noframe=true&skipHeaderFooter=true&ini=1644745366607&jumpDate="));
    document.getElementById("kidsbooking").setAttribute("src", nextevent("https://driftcartskids.youcanbook.me/service/jsps/cal.jsp?cal=645e88a9-22be-4ca8-952d-5d97ca05becd&noframe=true&skipHeaderFooter=true&ini=1644745406415&jumpDate="));
  });
 </script>

@plotti This is very interesting. This this doing the same thing as a minimum booking notice of two weeks would do? Essentially showing the availability two weeks in the future and beyond? Unless I am missing something.