<?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: Pijar Sukma Adiluhung</title>
    <description>The latest articles on DEV Community by Pijar Sukma Adiluhung (@pijaradiluhung).</description>
    <link>https://dev.to/pijaradiluhung</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%2F4099639%2F8bea9c17-5fa4-4ece-ac02-e2becfa6f52e.png</url>
      <title>DEV Community: Pijar Sukma Adiluhung</title>
      <link>https://dev.to/pijaradiluhung</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pijaradiluhung"/>
    <language>en</language>
    <item>
      <title>I Built an API Because My Government’s Website Got the Date Wrong (and Just… Deleted It)</title>
      <dc:creator>Pijar Sukma Adiluhung</dc:creator>
      <pubDate>Sat, 29 Aug 2026 03:26:27 +0000</pubDate>
      <link>https://dev.to/pijaradiluhung/i-built-an-api-because-my-governments-website-got-the-date-wrong-and-just-deleted-it-4ca5</link>
      <guid>https://dev.to/pijaradiluhung/i-built-an-api-because-my-governments-website-got-the-date-wrong-and-just-deleted-it-4ca5</guid>
      <description>&lt;p&gt;There’s a funny (and slightly sad) story behind why I built &lt;a href="https://mabims.dev" rel="noopener noreferrer"&gt;mabims.dev&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It started with a date.&lt;/p&gt;

&lt;p&gt;More specifically, a &lt;strong&gt;Hijri date&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Once Upon a Time, the Government Website Had the Date
&lt;/h2&gt;

&lt;p&gt;For a long time, Indonesia’s Ministry of Religious Affairs (Kemenag) website displayed the current Hijri date.&lt;/p&gt;

&lt;p&gt;It was convenient.&lt;/p&gt;

&lt;p&gt;You opened the website, looked at the corner of the page, and there it was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Today: 30 Sha'ban&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Simple enough.&lt;/p&gt;

&lt;p&gt;A lot of people, including me, got used to relying on it.&lt;/p&gt;

&lt;p&gt;Then one day, something weird happened.&lt;/p&gt;

&lt;p&gt;A post went viral.&lt;/p&gt;

&lt;p&gt;Someone noticed that the &lt;strong&gt;official calendar published by Kemenag said one date&lt;/strong&gt;, while the &lt;strong&gt;date displayed on Kemenag’s own website said the next day&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;They were off by one day.&lt;/p&gt;

&lt;p&gt;People started asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How can the official website and the official calendar disagree with each other?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The post spread.&lt;/p&gt;

&lt;p&gt;People discussed it.&lt;/p&gt;

&lt;p&gt;And then…&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution? Just Delete It.
&lt;/h2&gt;

&lt;p&gt;I didn't know what exactly happened behind the scenes.&lt;/p&gt;

&lt;p&gt;Maybe it was a bug.&lt;/p&gt;

&lt;p&gt;Maybe it was a calculation issue.&lt;/p&gt;

&lt;p&gt;Maybe the website was using a different data source.&lt;/p&gt;

&lt;p&gt;I don't know.&lt;/p&gt;

&lt;p&gt;But I do remember what happened eventually.&lt;/p&gt;

&lt;p&gt;The Hijri date disappeared from the website.&lt;/p&gt;

&lt;p&gt;Problem solved.&lt;/p&gt;

&lt;p&gt;Technically.&lt;/p&gt;

&lt;p&gt;If you can't display the wrong date, you can't display a wrong date.&lt;/p&gt;

&lt;p&gt;Elegant. 😂&lt;/p&gt;

&lt;p&gt;At the time, I just thought it was funny.&lt;/p&gt;

&lt;p&gt;A few years later, I became a developer.&lt;/p&gt;

&lt;p&gt;And suddenly, the story made a lot more sense.&lt;/p&gt;

&lt;h2&gt;
  
  
  Years Later, I Became a Junior Developer
&lt;/h2&gt;

&lt;p&gt;Once I started working as a developer, I learned how easy it is to add a Hijri date to a website.&lt;/p&gt;

&lt;p&gt;You don't need to calculate the lunar calendar yourself.&lt;/p&gt;

&lt;p&gt;You just install a library.&lt;/p&gt;

&lt;p&gt;Or call an API.&lt;/p&gt;

&lt;p&gt;There are plenty of them.&lt;/p&gt;

&lt;p&gt;The problem is that most of the libraries and APIs you'll find use &lt;strong&gt;Umm al-Qura&lt;/strong&gt; by default.&lt;/p&gt;

&lt;p&gt;And that's perfectly reasonable.&lt;/p&gt;

&lt;p&gt;Umm al-Qura is the official calendar of Saudi Arabia. It's well documented, widely supported, and easy to integrate.&lt;/p&gt;

&lt;p&gt;For a developer who just wants:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Gregorian date → Hijri date
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it works great.&lt;/p&gt;

&lt;p&gt;But there's a catch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Indonesia doesn't use the Saudi calendar as its official reference.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Indonesian context involves Kemenag's calendar, astronomical calculations, and the &lt;strong&gt;Neo MABIMS&lt;/strong&gt; criteria.&lt;/p&gt;

&lt;p&gt;As a result, the Hijri date can differ by one day.&lt;/p&gt;

&lt;p&gt;And suddenly that old story made sense.&lt;/p&gt;

&lt;p&gt;Maybe the problem wasn't really:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The code is wrong."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Maybe it was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"The code is using the wrong source of truth for the context."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's a very different problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  So I Looked for an Indonesian-Friendly API
&lt;/h2&gt;

&lt;p&gt;I started thinking about a fairly simple question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If I'm an Indonesian developer and I want to display the Hijri date according to Kemenag, what do I use?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The answer wasn't particularly satisfying.&lt;/p&gt;

&lt;p&gt;I could:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scrape Kemenag's website.&lt;/li&gt;
&lt;li&gt;Maintain my own calendar table.&lt;/li&gt;
&lt;li&gt;Find some obscure data source.&lt;/li&gt;
&lt;li&gt;Calculate everything myself.&lt;/li&gt;
&lt;li&gt;Or just use a normal Hijri API and accept that it might be a day off.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of those felt particularly great.&lt;/p&gt;

&lt;p&gt;And option #4 is especially dangerous.&lt;/p&gt;

&lt;p&gt;Because the application will happily tell users:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;1 Ramadan&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;while the official Indonesian calendar says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;30 Sha'ban&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Your code isn't crashing.&lt;/p&gt;

&lt;p&gt;Your API isn't returning an error.&lt;/p&gt;

&lt;p&gt;Your tests might all pass.&lt;/p&gt;

&lt;p&gt;Everything looks fine.&lt;/p&gt;

&lt;p&gt;The date is just… wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  So I Built One
&lt;/h2&gt;

&lt;p&gt;That's why I built &lt;strong&gt;&lt;a href="https://mabims.dev" rel="noopener noreferrer"&gt;mabims.dev&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It's a Hijri calendar API designed specifically for the Indonesian context.&lt;/p&gt;

&lt;p&gt;The primary source is the &lt;strong&gt;official Kemenag RI calendar&lt;/strong&gt;, with &lt;strong&gt;Neo MABIMS&lt;/strong&gt; criteria used as a fallback outside the available official data range.&lt;/p&gt;

&lt;p&gt;The goal is deliberately simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your application
       ↓
   mabims.dev
       ↓
Kemenag / Neo MABIMS
       ↓
Indonesian Hijri date
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No API key.&lt;/p&gt;

&lt;p&gt;No complicated authentication.&lt;/p&gt;

&lt;p&gt;No scraping required on the developer's side.&lt;/p&gt;

&lt;p&gt;Just call an endpoint.&lt;/p&gt;

&lt;p&gt;For example:&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="s2"&gt;"https://api.mabims.dev/api/v1/today"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you get the current Hijri date according to the project's Indonesian calendar reference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Not Just Use Umm al-Qura?
&lt;/h2&gt;

&lt;p&gt;To be clear: &lt;strong&gt;Umm al-Qura isn't bad.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's a perfectly legitimate calendar system.&lt;/p&gt;

&lt;p&gt;If you're building something for Saudi Arabia, or your application specifically needs Umm al-Qura, use it.&lt;/p&gt;

&lt;p&gt;The problem is assuming that:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Hijri calendar = one universal calendar."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It isn't quite that simple.&lt;/p&gt;

&lt;p&gt;Different countries and institutions can use different methodologies, observations, calculations, and official decisions.&lt;/p&gt;

&lt;p&gt;And when you're building software that deals with religious dates, a difference of one day isn't necessarily a minor UI issue.&lt;/p&gt;

&lt;p&gt;It can affect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ramadan&lt;/li&gt;
&lt;li&gt;Eid&lt;/li&gt;
&lt;li&gt;fasting schedules&lt;/li&gt;
&lt;li&gt;Islamic events&lt;/li&gt;
&lt;li&gt;religious announcements&lt;/li&gt;
&lt;li&gt;prayer-related applications&lt;/li&gt;
&lt;li&gt;educational content&lt;/li&gt;
&lt;li&gt;community calendars&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For an Indonesian application, the Indonesian source of truth matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  I'm Not an Astronomer
&lt;/h2&gt;

&lt;p&gt;There's another reason I wanted to build this as an API.&lt;/p&gt;

&lt;p&gt;Developers shouldn't have to become astronomers just to display a calendar.&lt;/p&gt;

&lt;p&gt;If an application needs the Indonesian Hijri date, the developer should be able to write something like:&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;today&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://api.mabims.dev/api/v1/today&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;and move on with building the actual application.&lt;/p&gt;

&lt;p&gt;The complicated part: calendar data, methodology, historical coverage, and fallback logic, belongs behind the API.&lt;/p&gt;

&lt;p&gt;That's what APIs are good at.&lt;/p&gt;

&lt;h2&gt;
  
  
  Will Anyone Actually Use It?
&lt;/h2&gt;

&lt;p&gt;Honestly?&lt;/p&gt;

&lt;p&gt;I have no idea.&lt;/p&gt;

&lt;p&gt;Maybe nobody will.&lt;/p&gt;

&lt;p&gt;But at least one application already uses it:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://kajian.malangmengaji.com" rel="noopener noreferrer"&gt;kajian.malangmengaji.com&lt;/a&gt;&lt;/strong&gt;, which I also built.&lt;/p&gt;

&lt;p&gt;So even if nobody else ever uses the API, it still solves a real problem for one of my own projects.&lt;/p&gt;

&lt;p&gt;And that's good enough reason for me.&lt;/p&gt;

&lt;p&gt;If other Indonesian developers find it useful, even better.&lt;/p&gt;

&lt;h2&gt;
  
  
  It's Free and Open Source
&lt;/h2&gt;

&lt;p&gt;I wanted the barrier to adoption to be as low as possible.&lt;/p&gt;

&lt;p&gt;So:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Free to use&lt;/li&gt;
&lt;li&gt;No API key&lt;/li&gt;
&lt;li&gt;Open source&lt;/li&gt;
&lt;li&gt;Simple HTTP API&lt;/li&gt;
&lt;li&gt;Designed around the Indonesian context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can try it right now:&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="s2"&gt;"https://api.mabims.dev/api/v1/today"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The full documentation is available at:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://mabims.dev/quickstart" rel="noopener noreferrer"&gt;https://mabims.dev/quickstart&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Real Lesson
&lt;/h2&gt;

&lt;p&gt;The funny thing about this project is that it didn't start with:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I'm going to build a Hijri calendar API."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It started with:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Why is the official website showing the wrong date?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then years later, after becoming a developer, I realized that the problem wasn't necessarily a broken algorithm.&lt;/p&gt;

&lt;p&gt;Sometimes software can be perfectly correct &lt;strong&gt;and still produce the wrong answer&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Because the source of truth is wrong.&lt;/p&gt;

&lt;p&gt;That's a lesson I keep finding useful in software engineering:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Correct code + wrong assumptions = wrong software.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And sometimes, instead of deleting the feature…&lt;/p&gt;

&lt;p&gt;you just need to build a better API.&lt;/p&gt;

&lt;p&gt;Hopefully, this one won't have to be deleted because it got the date wrong. :)&lt;/p&gt;

</description>
      <category>api</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
