<?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: What Week Is It</title>
    <description>The latest articles on DEV Community by What Week Is It (@weekisit).</description>
    <link>https://dev.to/weekisit</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%2F3961611%2Fe222e27e-d294-4971-a986-ab2dcd3d73a7.png</url>
      <title>DEV Community: What Week Is It</title>
      <link>https://dev.to/weekisit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/weekisit"/>
    <language>en</language>
    <item>
      <title>2026 Has 53 Weeks. Here's the Bug That's About to Surface.</title>
      <dc:creator>What Week Is It</dc:creator>
      <pubDate>Sun, 31 May 2026 20:49:19 +0000</pubDate>
      <link>https://dev.to/weekisit/2026-has-53-weeks-heres-the-bug-thats-about-to-surface-3d1i</link>
      <guid>https://dev.to/weekisit/2026-has-53-weeks-heres-the-bug-thats-about-to-surface-3d1i</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;TL;DR 2026 is a 53 week year (ISO 8601). If anything in your stack assumes a year has 52 weeks a % 52, a fixed length array, a chart axis, a weekly aggregation it has a latent bug that this year will trigger. Don't hard code 52. Here's how to spot it and fix it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Quick gut check before you read on: &lt;strong&gt;how many weeks are in a year?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you answered 52, you're right about 80% of the time. The other 20% of the time there are 53, and the code that assumed 52 does something quietly wrong drops a week of data, wraps a counter, throws an index error, or labels two different weeks with the same number. 2026 is one of those years, which makes this a good moment to go find that bug before it finds you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wait, how can a year have 53 weeks?
&lt;/h2&gt;

&lt;p&gt;ISO 8601 weeks start on Monday, and a week belongs to whichever year holds its Thursday. Stack 52 of those and you get 364 days one short of a normal year, two short of a leap year. That leftover day accumulates, and every so often the calendar pays off its debt with a 53rd week.&lt;/p&gt;

&lt;p&gt;Mechanically, a year gets 53 ISO weeks when January 1st falls on a Thursday, or on a Wednesday in a leap year. That works out to roughly once every five or six years:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;... 2015, 2020, 2026, 2032, 2037 ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2026 qualifies because January 1st, 2026 is a Thursday. So this year runs Monday weeks 1 through &lt;strong&gt;53&lt;/strong&gt;, and the calendar genuinely has a &lt;a href="https://weekisit.com/week-numbers-2026" rel="noopener noreferrer"&gt;week 53 sitting in late December&lt;/a&gt;. It is not an off-by-one in your head it's the standard.&lt;/p&gt;

&lt;p&gt;The previous 53 week year was 2020. If your codebase is younger than that, &lt;strong&gt;it has very possibly never executed against a 53 week year in production&lt;/strong&gt;. That's exactly the kind of edge case that ships green and breaks live.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it actually bites
&lt;/h2&gt;

&lt;p&gt;This is rarely a dramatic crash. It's the quiet, plausible looking wrongness that survives code review. A few real shapes it takes:&lt;br&gt;
&lt;strong&gt;1. The modulo that wraps&lt;/strong&gt;. Anything doing week math with &lt;code&gt;% 52&lt;/code&gt; collapses week 53 onto week 1:&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;slot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;weekNumber&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;52&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// week 53 -&amp;gt; slot 1, silently merged with week 1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now week 1 and week 53 land in the same bucket. Your year-end aggregate double-counts, and your January numbers look inexplicably high.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The fixed-length structure&lt;/strong&gt;. &lt;code&gt;A new Array(52)&lt;/code&gt;, a 52-column table, a 52-element enum, a chart with 52 ticks. Week 53 either overflows, gets truncated, or throws:&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;weeklyTotals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;52&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;weeklyTotals&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;week&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// week === 53 -&amp;gt; index 52 -&amp;gt; undefined slot&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. The week-over-week comparison&lt;/strong&gt;. "This week vs. the same week last year" assumes both years have the same weeks. 2025 (52 weeks) vs. 2026 (53 weeks) don't line up, and your YoY dashboard quietly misaligns by the end of December.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. The off-by-one cousin&lt;/strong&gt;. Closely related and worth knowing: a week can belong to a different year than its calendar dates suggest. January 1st, 2027 is actually &lt;strong&gt;week 53 of 2026&lt;/strong&gt;, not week 1 of 2027. If you ever pair an ISO week with &lt;code&gt;getFullYear()&lt;/code&gt; instead of the ISO week-numbering year, that's a separate bug hiding right next to this one. (Different rabbit hole; the &lt;a href="https://weekisit.com/iso-week-number" rel="noopener noreferrer"&gt;ISO week number guide&lt;/a&gt; covers it if you want the full mechanics.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Detecting a 53-week year in code
&lt;/h2&gt;

&lt;p&gt;You don't need a lookup table. There's one date that is always in the final ISO week of its year: December 28th. So the week number of &lt;strong&gt;December 28th&lt;/strong&gt; tells you how many weeks the year has:&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;function&lt;/span&gt; &lt;span class="nf"&gt;isoWeek&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setHours&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// jump to the Thursday of this ISO week&lt;/span&gt;
  &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setDate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getDate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getDay&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;week1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getFullYear&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;week1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;86400000&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;week1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getDay&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;weeksInYear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;year&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;isoWeek&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;year&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;28&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// Dec 28 -&amp;gt; last week of the year&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;weeksInYear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2025&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 52&lt;/span&gt;
&lt;span class="nf"&gt;weeksInYear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2026&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 53&lt;/span&gt;
&lt;span class="nf"&gt;weeksInYear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2027&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 52&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most date libraries ship this too reach for their &lt;code&gt;getISOWeeksInYear&lt;/code&gt;-style helper rather than rolling your own, and pull the week-numbering year from the library instead of the plain calendar year.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fixing it without playing whack-a-mole
&lt;/h2&gt;

&lt;p&gt;The fix is the same idea everywhere: &lt;strong&gt;stop treating 52 as a constant&lt;/strong&gt;. Concretely:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Size structures dynamically: &lt;code&gt;new Array(weeksInYear(year))&lt;/code&gt;, not &lt;code&gt;new Array(52)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Drop the &lt;code&gt;% 52&lt;/code&gt;. If you're bucketing by week, key on the &lt;strong&gt;&lt;code&gt;{isoYear, isoWeek}&lt;/code&gt;&lt;/strong&gt; &lt;strong&gt;pair&lt;/strong&gt; so week 53 and the next year's week 1 can never collide.&lt;/li&gt;
&lt;li&gt;For YoY comparisons, align on the ISO week label, and decide explicitly what to do with the orphan 53rd week (carry it, or compare W53 against the prior year's W52 - just make it a deliberate choice).&lt;/li&gt;
&lt;li&gt;Add a test that runs your week logic against a known 53-week year. 2026 and 2020 are free test fixtures.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;handles 53-week years&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;weeksInYear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2026&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;53&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;bucketsFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2026&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toHaveLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;53&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// not 52&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want a CI canary, a one-line guard that logs when the current year has 53 weeks is a cheap way to get a heads-up the next time this rolls around (2032).&lt;/p&gt;

&lt;h2&gt;
  
  
  When you'd rather not own the logic at all
&lt;/h2&gt;

&lt;p&gt;For a lot of cases - a status badge, a Slack reminder, a report header, a cron that needs "is this a long year?" - shipping date arithmetic is more risk than it's worth. There's a free, no-key JSON API that returns the week info for any date, and it hands you the 53-week answer as a plain boolean so you don't have to derive it:&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;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://weekisit.com/api/week&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;iso_week&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;          &lt;span class="c1"&gt;// 22&lt;/span&gt;
&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;total_weeks_in_year&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 53&lt;/span&gt;
&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;is_53_week_year&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;     &lt;span class="c1"&gt;// true  &amp;lt;-- the whole problem, as one field&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;is_53_week_year&lt;/code&gt; flag is doing exactly the job of the &lt;code&gt;weeksInYear&lt;/code&gt; function above, minus the maintenance. The &lt;a href="https://weekisit.com/api" rel="noopener noreferrer"&gt;endpoint&lt;/a&gt; is CORS-enabled, so you can call it straight from front-end code; just cache the result, since the answer only changes once a year.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 53-week year is bigger in finance than you think
&lt;/h2&gt;

&lt;p&gt;If you work anywhere near retail, billing, or reporting, this isn't a curiosity - it's a scheduled event. The &lt;strong&gt;4-4-5 retail calendar&lt;/strong&gt; (and the NRF's 4-5-4 variant) is built on 52-week years of exactly 364 days, and it deliberately inserts a 53rd week every five or six years to resync with the actual calendar. Whole quarters of financial comparison hinge on whether a given year is a 52- or 53-week year. If your data model serves finance, the &lt;a href="https://weekisit.com/fiscal-calendar" rel="noopener noreferrer"&gt;fiscal calendar breakdown&lt;/a&gt; is worth a read before you hard-code anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;2026 has &lt;strong&gt;53 ISO weeks&lt;/strong&gt;. The previous one was 2020; the next is 2032.&lt;/li&gt;
&lt;li&gt;A year has 53 weeks when Jan 1 is a Thursday (or a Wednesday in a leap year).&lt;/li&gt;
&lt;li&gt;Never treat 52 as a constant: no &lt;code&gt;% 52&lt;/code&gt;, no fixed 52-length structures, no naive YoY alignment.&lt;/li&gt;
&lt;li&gt;Bucket by the &lt;code&gt;{isoYear, isoWeek}&lt;/code&gt; pair so week 53 never collides with anyone's week 1.&lt;/li&gt;
&lt;li&gt;Test against 2026 and 2020, or offload the question entirely with a single &lt;code&gt;is_53_week_year&lt;/code&gt; boolean.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Week numbers feel like the most boring possible part of date handling, right up until a 53-week year turns a one-character assumption into a year-end incident. Spend ten minutes grepping your codebase for &lt;code&gt;52&lt;/code&gt; this week. Future-you, sometime around late December, will be grateful.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>datetime</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
