<?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: Ricky Spears</title>
    <description>The latest articles on DEV Community by Ricky Spears (@rickyspears).</description>
    <link>https://dev.to/rickyspears</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3849689%2F771ab88d-3657-4af4-a604-73524497108c.jpeg</url>
      <title>DEV Community: Ricky Spears</title>
      <link>https://dev.to/rickyspears</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rickyspears"/>
    <language>en</language>
    <item>
      <title>I Built a `cal` Endpoint Because Windows Still Doesn’t Have One</title>
      <dc:creator>Ricky Spears</dc:creator>
      <pubDate>Sun, 29 Mar 2026 16:58:25 +0000</pubDate>
      <link>https://dev.to/rickyspears/i-built-a-cal-endpoint-because-windows-still-doesnt-have-one-2p5a</link>
      <guid>https://dev.to/rickyspears/i-built-a-cal-endpoint-because-windows-still-doesnt-have-one-2p5a</guid>
      <description>&lt;p&gt;If you've spent any time on a Linux or macOS terminal, you've probably typed &lt;code&gt;cal&lt;/code&gt; at least once. It's one of those tiny little utilities that's almost too simple to matter — until you're on a Windows machine, you need a quick calendar reference, and you realize it's just... not there.&lt;/p&gt;

&lt;p&gt;CMD doesn't have it. PowerShell doesn't have it. And I'm not about to install some third-party tool just to see what day of the week the 15th falls on.&lt;/p&gt;

&lt;p&gt;So I built my own, and I'm kind of unreasonably happy about it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Fix: A cURL-Accessible Calendar Endpoint
&lt;/h2&gt;

&lt;p&gt;It lives at &lt;a href="https://rickys.dev/calendar/" rel="noopener noreferrer"&gt;rickys.dev/calendar&lt;/a&gt; and works exactly the way &lt;code&gt;cal&lt;/code&gt; does — except you hit it with cURL instead of running a local command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; rickys.dev/calendar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That gives you the current month, plain text, right in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      March 2026
Su Mo Tu We Th Fr Sa
 1  2  3  4  5  6  7
 8  9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Today's date is highlighted in bold cyan — same feel as &lt;code&gt;cal&lt;/code&gt; on Linux. On Windows it renders cleanly in Windows Terminal; classic CMD may show the ANSI codes as literal text depending on your setup.&lt;/p&gt;




&lt;h2&gt;
  
  
  It Takes Parameters
&lt;/h2&gt;

&lt;p&gt;This is where it gets a little more useful than just a party trick.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Specific month or year:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="s2"&gt;"rickys.dev/calendar?month=6&amp;amp;year=2026"&lt;/span&gt;
curl &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="s2"&gt;"rickys.dev/calendar?year=2026"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://rickys.dev/calendar/?year=2026" rel="noopener noreferrer"&gt;Full year view&lt;/a&gt; renders 3 months across, just like &lt;code&gt;cal -y&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before and after (like &lt;code&gt;cal -B&lt;/code&gt; and &lt;code&gt;-A&lt;/code&gt;):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="s2"&gt;"rickys.dev/calendar?before=2&amp;amp;after=5"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://rickys.dev/calendar/?before=2&amp;amp;after=5" rel="noopener noreferrer"&gt;That URL&lt;/a&gt; shows a rolling window of months centered on today — handy when you're planning something that spans a few months and don't want to keep re-running the command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Control the column width:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="s2"&gt;"rickys.dev/calendar?year=2026&amp;amp;column=1"&lt;/span&gt;
curl &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="s2"&gt;"rickys.dev/calendar?before=2&amp;amp;after=5&amp;amp;column=2"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://rickys.dev/calendar/?year=2026&amp;amp;column=1" rel="noopener noreferrer"&gt;Stacked vertically&lt;/a&gt; is great for narrow terminals or piping. &lt;a href="https://rickys.dev/calendar/?before=2&amp;amp;after=5&amp;amp;column=2" rel="noopener noreferrer"&gt;Two across&lt;/a&gt; hits a nice middle ground when you want context without the full 3-wide spread.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works Under the Hood
&lt;/h2&gt;

&lt;p&gt;It's a single &lt;code&gt;index.php&lt;/code&gt; file sitting in a &lt;code&gt;calendar/&lt;/code&gt; folder on the server. Nothing exotic.&lt;/p&gt;

&lt;p&gt;When a request comes in, the script checks the &lt;code&gt;User-Agent&lt;/code&gt; header. If it sees &lt;code&gt;curl&lt;/code&gt;, &lt;code&gt;wget&lt;/code&gt;, or &lt;code&gt;httpie&lt;/code&gt;, it returns &lt;code&gt;Content-Type: text/plain&lt;/code&gt; with ANSI escape codes for the today highlight. If it sees a browser, it returns a styled HTML page with the same calendar — navigation links included, today highlighted in amber.&lt;/p&gt;

&lt;p&gt;You can also force plain text in a browser by appending &lt;code&gt;&amp;amp;plain&lt;/code&gt; to any URL, which I mostly use for testing without opening a terminal.&lt;/p&gt;

&lt;p&gt;The month math handles year-boundary wrapping correctly, so &lt;code&gt;?before=3&lt;/code&gt; in January won't blow up — it'll walk back into the previous year without complaint.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;If you're on Windows and want a quick cal equivalent without installing anything, bookmark this or drop an alias in your PowerShell profile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="kr"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;cal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;curl.exe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-L&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rickys.dev/calendar/&lt;/span&gt;&lt;span class="bp"&gt;$args&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, cal just works. You can even do &lt;code&gt;cal '?year=2026'&lt;/code&gt; and the parameters pass right through.&lt;br&gt;
The full source and parameter reference are on &lt;a href="https://github.com/rickyspears/calendar-endpoint" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; if you want to self-host it or poke around in the code.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>php</category>
      <category>cmd</category>
      <category>powershell</category>
    </item>
  </channel>
</rss>
