<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Asad Yasin</title>
    <description>The latest articles on DEV Community by Asad Yasin (@em_asad).</description>
    <link>https://dev.to/em_asad</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4019041%2F5f88b233-6054-494d-ade0-2ac966877a8a.jpg</url>
      <title>DEV Community: Asad Yasin</title>
      <link>https://dev.to/em_asad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/em_asad"/>
    <language>en</language>
    <item>
      <title>Why scheduling tools get availability wrong (and how to fix it)</title>
      <dc:creator>Asad Yasin</dc:creator>
      <pubDate>Tue, 07 Jul 2026 08:19:25 +0000</pubDate>
      <link>https://dev.to/em_asad/why-scheduling-tools-get-availability-wrong-and-how-to-fix-it-1807</link>
      <guid>https://dev.to/em_asad/why-scheduling-tools-get-availability-wrong-and-how-to-fix-it-1807</guid>
      <description>&lt;p&gt;Most scheduling tools work the same way under the hood.&lt;/p&gt;

&lt;p&gt;They take your available hours, divide them by a slot duration, and hand you a grid of fixed times. 9:00, 9:30, 10:00, 10:30. Pick one.&lt;/p&gt;

&lt;p&gt;It works. But it has a fundamental flaw.&lt;/p&gt;

&lt;h2&gt;
  
  
  The grid assumption
&lt;/h2&gt;

&lt;p&gt;When you pre-generate slots, you make a hard assumption: that every slot boundary is equally valid. But real calendars don't work that way.&lt;/p&gt;

&lt;p&gt;Say you have a rule: available 9am–12pm, 30-minute slots. A calendar event ends at 9:45am. The grid-based approach blocks the entire 9:00 and 9:30 slots, even though there's a valid 30-minute window from 9:45–10:15 that the guest could book.&lt;/p&gt;

&lt;p&gt;You've just hidden availability that genuinely exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  Free windows instead of fixed slots
&lt;/h2&gt;

&lt;p&gt;A better approach: compute free windows, not pre-generated slots.&lt;/p&gt;

&lt;p&gt;Instead of dividing your schedule into a grid upfront, you:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start with your defined available hours as a continuous interval&lt;/li&gt;
&lt;li&gt;Subtract all busy time — calendar events, existing bookings, 
buffers, manual blocks, holidays&lt;/li&gt;
&lt;li&gt;What remains is a set of free windows — open intervals of 
varying length&lt;/li&gt;
&lt;li&gt;At booking time, check: does the requested duration fit 
entirely inside one of these windows?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This means a guest can start at 9:45, 10:00, 10:15 — any 15-minute mark where their chosen duration fits inside an open window. Not just the pre-generated grid positions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The implementation difference
&lt;/h2&gt;

&lt;p&gt;Grid approach (simplified):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_slots&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;available_start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;available_end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;duration_mins&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;slots&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;available_start&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;timedelta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;minutes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;duration_mins&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;available_end&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nf"&gt;is_busy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;timedelta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;minutes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;duration_mins&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
            &lt;span class="n"&gt;slots&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nf"&gt;timedelta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;minutes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;duration_mins&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;slots&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Free-window approach:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_free_windows&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;available_start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;available_end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;busy_periods&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Start with the full available interval
&lt;/span&gt;    &lt;span class="n"&gt;free&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="n"&gt;available_start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;available_end&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;

    &lt;span class="c1"&gt;# Subtract each busy period
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;busy_start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;busy_end&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;busy_periods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;free&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;subtract_interval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;free&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;busy_start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;busy_end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Return windows large enough for at least one slot
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;free&lt;/span&gt; 
            &lt;span class="nf"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;seconds&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;MIN_DURATION_MINS&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The guest-facing slot picker then steps through each free window in 15-minute increments, showing any start time where their chosen duration fits completely inside the window.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters in practice
&lt;/h2&gt;

&lt;p&gt;The difference becomes obvious on heavy calendar days.&lt;/p&gt;

&lt;p&gt;With a grid: a 90-minute meeting ending at 11:30 wipes out the 11:00 and 11:30 slots even if there's a clear 30-minute window from 11:30–12:00.&lt;/p&gt;

&lt;p&gt;With free windows: that 11:30–12:00 window surfaces correctly. &lt;br&gt;
The guest sees it. They can book it.&lt;/p&gt;

&lt;p&gt;For hosts with back-to-back schedules — the exact people who most need a scheduling tool — the grid approach quietly hides valid availability. Free windows don't.&lt;/p&gt;

&lt;h2&gt;
  
  
  One more thing: confirm-time safety
&lt;/h2&gt;

&lt;p&gt;Computing free windows solves the display problem. But there's a second problem: what if the calendar changes between when the guest loads the page and when they confirm?&lt;/p&gt;

&lt;p&gt;The answer is cache-first with confirm-time re-validation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Show availability from a local cache (fast page loads, no live API call on every request)&lt;/li&gt;
&lt;li&gt;At the moment of confirm, re-fetch the host's calendar live and check the exact interval one more time&lt;/li&gt;
&lt;li&gt;If something changed, reject with a 409 and let the guest pick again&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means a guest can never successfully book a slot that became unavailable while they were on the page — even if the cache was slightly stale.&lt;/p&gt;




&lt;p&gt;These are the core ideas behind how we built availability in &lt;a href="https://skedvio.com" rel="noopener noreferrer"&gt;Skedvio&lt;/a&gt; — a scheduling tool that computes free windows rather than a fixed slot grid. If you're building something similar or just find the problem interesting, I'd love to hear how you've approached it.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>javascript</category>
      <category>saas</category>
    </item>
  </channel>
</rss>
