<?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: Xian X</title>
    <description>The latest articles on DEV Community by Xian X (@xian_x_9469bb3e1b9a2f6ed0).</description>
    <link>https://dev.to/xian_x_9469bb3e1b9a2f6ed0</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%2F3986589%2Fe389cd55-081d-4ee5-8ca4-b1e414fb0de4.png</url>
      <title>DEV Community: Xian X</title>
      <link>https://dev.to/xian_x_9469bb3e1b9a2f6ed0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xian_x_9469bb3e1b9a2f6ed0"/>
    <language>en</language>
    <item>
      <title>Date-counting bugs I test before shipping a deadline calculator</title>
      <dc:creator>Xian X</dc:creator>
      <pubDate>Wed, 17 Jun 2026 17:04:36 +0000</pubDate>
      <link>https://dev.to/xian_x_9469bb3e1b9a2f6ed0/date-counting-bugs-i-test-before-shipping-a-deadline-calculator-4o8f</link>
      <guid>https://dev.to/xian_x_9469bb3e1b9a2f6ed0/date-counting-bugs-i-test-before-shipping-a-deadline-calculator-4o8f</guid>
      <description>&lt;p&gt;When I built a small deadline calculator, the hard part was not adding N days. The hard part was avoiding the quiet assumptions that make date tools wrong.&lt;/p&gt;

&lt;p&gt;Here is the checklist I now use before trusting a court-day or business-day calculation:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Decide whether the start date counts. Many workflows start counting from the next day, not the event day.&lt;/li&gt;
&lt;li&gt;Separate calendar days from court/business days. A UI should make that choice explicit.&lt;/li&gt;
&lt;li&gt;Treat weekends as data, not decoration. They change the result, so they need tests.&lt;/li&gt;
&lt;li&gt;Keep holiday rules visible. If the jurisdiction or court has a special closure, the calculator should not pretend to know it unless that rule is actually encoded.&lt;/li&gt;
&lt;li&gt;Show the skipped dates. A final date without the path is hard to audit.&lt;/li&gt;
&lt;li&gt;Keep a disclaimer near the result. A calculator can help with arithmetic, but it cannot replace the controlling local rule or court order.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A tiny test fixture I like is this shape:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;addCourtDays&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;startDate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2026-06-16&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;daysToAdd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;holidays&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2026-06-19&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;countFromNextDay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dueDate&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2026-07-01&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I keep a public reference implementation here: &lt;a href="https://courtdayscalc.com/" rel="noopener noreferrer"&gt;Court Days Calculator&lt;/a&gt;. I use it as a quick arithmetic sanity check, not as legal advice. The useful part is that it shows the counted and skipped days so the result can be reviewed instead of blindly copied.&lt;/p&gt;

&lt;p&gt;The broader lesson applies to any date-heavy product: make the rule choices visible, test the exceptions, and avoid hiding uncertainty behind a single confident-looking date.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>programming</category>
      <category>softwaredevelopment</category>
      <category>testing</category>
    </item>
    <item>
      <title>Date math notes for a court deadline calculator</title>
      <dc:creator>Xian X</dc:creator>
      <pubDate>Tue, 16 Jun 2026 04:47:07 +0000</pubDate>
      <link>https://dev.to/xian_x_9469bb3e1b9a2f6ed0/date-math-notes-for-a-court-deadline-calculator-2ljk</link>
      <guid>https://dev.to/xian_x_9469bb3e1b9a2f6ed0/date-math-notes-for-a-court-deadline-calculator-2ljk</guid>
      <description>&lt;p&gt;Date calculators look simple until the rules around the date become the main product. I have been using a small court-day calculator as a reminder to keep the implementation boring, explicit, and easy to audit.&lt;/p&gt;

&lt;p&gt;The most important design decision is to separate ordinary calendar math from jurisdiction-specific legal rules. A tool can help someone count days, compare deadlines, and avoid manual arithmetic mistakes, but it should not pretend to replace local court rules or legal advice. That boundary needs to be visible in both the interface and the page copy.&lt;/p&gt;

&lt;p&gt;For the calculator workflow, I keep a few implementation notes close to the code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Normalize all input dates before doing any counting.&lt;/li&gt;
&lt;li&gt;Show the start date and end date in the result, not only the final number.&lt;/li&gt;
&lt;li&gt;Make weekend and holiday assumptions explicit.&lt;/li&gt;
&lt;li&gt;Keep a plain-language explanation beside the result so users can catch obvious mistakes.&lt;/li&gt;
&lt;li&gt;Avoid hidden defaults when a date rule could change the answer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The small calculator page I am using for these checks is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://courtdayscalc.com/" rel="noopener noreferrer"&gt;https://courtdayscalc.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A useful test case is to compare a short same-week range, a range that crosses a weekend, and a range that crosses a month boundary. Those three cases catch many accidental off-by-one errors before the tool reaches real users.&lt;/p&gt;

&lt;p&gt;For any legal-adjacent utility, clarity matters more than cleverness. The safest pattern is to make the arithmetic transparent, expose assumptions, and tell users when they need to verify a rule outside the tool.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>productivity</category>
      <category>programming</category>
      <category>software</category>
    </item>
    <item>
      <title>Notes from maintaining a small game reference page</title>
      <dc:creator>Xian X</dc:creator>
      <pubDate>Tue, 16 Jun 2026 04:42:23 +0000</pubDate>
      <link>https://dev.to/xian_x_9469bb3e1b9a2f6ed0/notes-from-maintaining-a-small-game-reference-page-5edp</link>
      <guid>https://dev.to/xian_x_9469bb3e1b9a2f6ed0/notes-from-maintaining-a-small-game-reference-page-5edp</guid>
      <description>&lt;p&gt;I have been keeping notes on a small fan reference page and wanted to write down the checks that made it less fragile. The main lesson is that a reference page should not try to look bigger than the information it can verify. A short page with clear scope is more useful than a large page padded with guesses.&lt;/p&gt;

&lt;p&gt;For game notes, I now separate three things before publishing: confirmed mechanics, change-prone observations, and open questions. Confirmed items can sit in the main table. Change-prone items need a date or version note. Open questions should stay out of the main answer until there is better evidence.&lt;/p&gt;

&lt;p&gt;That process also makes updates faster. When a player reports a change, I can compare it against the current notes instead of rewriting the whole page. It is a small workflow, but it prevents the common wiki problem where old information stays visible because nobody remembers why it was added.&lt;/p&gt;

&lt;p&gt;The current reference page I am using for this workflow is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://growagardens2.com/" rel="noopener noreferrer"&gt;https://growagardens2.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A simple checklist I use before updating a page:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can this claim be checked from more than one source or direct play?&lt;/li&gt;
&lt;li&gt;Does the page show the limits of what is known?&lt;/li&gt;
&lt;li&gt;Are dates or version notes included where the information may change?&lt;/li&gt;
&lt;li&gt;Is the answer easy to scan on mobile?&lt;/li&gt;
&lt;li&gt;Would a new reader understand the next action without reading the whole page?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Small reference projects do not need heavy infrastructure. They need careful wording, repeatable checks, and a willingness to leave uncertain details unpublished until they are verified.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>gamedev</category>
      <category>documentation</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
