# Show the next available slot

**URL:** <https://forum.youcanbook.me/t/show-the-next-available-slot/1672>\
**Category:** Feature Requests\
**Created:** [April 13, 2022, 10:21am UTC](https://forum.youcanbook.me/t/show-the-next-available-slot/1672 "2022-04-13T10:21:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![plotti](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@plotti](https://forum.youcanbook.me/u/plotti)\
**Post date:** [April 13, 2022, 10:21am UTC](https://forum.youcanbook.me/t/show-the-next-available-slot/1672/1 "2022-04-13T10:21:29Z")

</div>

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:

 ![Bildschirmfoto 2022-04-13 um 12.17.34](https://canada1.discourse-cdn.com/flex027/uploads/ycbm/original/1X/a356e54845547cacfe09be8bbb92cd559159a278.png)

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

[Driftcarts Erwachsene](https://aws.youcanbook.me/service/jsps/cal.jsp?cal=d2370ff9-256e-4da3-91c3-f9f3ab786b9d&oo=2020-11-04T21:55:46Z&preview=true&lorem=true&appRequestedAt=1649845114235&ini=1649845129920&) **jumpDate=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

---

<div class="post-metadata">

**Author:** ![Ben](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.youcanbook.me/ben/32/772_2.png) [@Ben](https://forum.youcanbook.me/u/Ben)\
**Post date:** [April 13, 2022, 1:50pm UTC](https://forum.youcanbook.me/t/show-the-next-available-slot/1672/2 "2022-04-13T13:50:32Z")

</div>

@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](https://support.youcanbook.me/article/77-set-fixed-start-and-end-dates-for-your-bookings). But you would have to change this periodically.

---

<div class="post-metadata">

**Author:** ![Highland](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.youcanbook.me/highland/32/831_2.png) [@Highland](https://forum.youcanbook.me/u/Highland)\
**Post date:** [April 18, 2022, 8:09pm UTC](https://forum.youcanbook.me/t/show-the-next-available-slot/1672/3 "2022-04-18T20:09:45Z")

</div>

This feature would be very welcome

---

<div class="post-metadata">

**Author:** ![LeroySchulz](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.youcanbook.me/leroyschulz/32/344_2.png) [@LeroySchulz](https://forum.youcanbook.me/u/LeroySchulz)\
**Post date:** [April 21, 2022, 4:17am UTC](https://forum.youcanbook.me/t/show-the-next-available-slot/1672/4 "2022-04-21T04:17:07Z")

</div>

This would be a handy feature.

---

<div class="post-metadata">

**Author:** ![plotti](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@plotti](https://forum.youcanbook.me/u/plotti)\
**Post date:** [May 5, 2022, 8:33pm UTC](https://forum.youcanbook.me/t/show-the-next-available-slot/1672/5 "2022-05-05T20:33:41Z")

</div>

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.

```auto
<!-- 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>

```

---

<div class="post-metadata">

**Author:** ![Ben](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.youcanbook.me/ben/32/772_2.png) [@Ben](https://forum.youcanbook.me/u/Ben)\
**Post date:** [May 9, 2022, 12:46pm UTC](https://forum.youcanbook.me/t/show-the-next-available-slot/1672/6 "2022-05-09T12:46:27Z")

</div>

@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.
