<?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: Bijay Thapa</title>
    <description>The latest articles on DEV Community by Bijay Thapa (@bijay_thapa_29fd55e45a027).</description>
    <link>https://dev.to/bijay_thapa_29fd55e45a027</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%2F4216926%2F18c2069b-6fa8-4a2b-830c-e63a81b3627f.png</url>
      <title>DEV Community: Bijay Thapa</title>
      <link>https://dev.to/bijay_thapa_29fd55e45a027</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bijay_thapa_29fd55e45a027"/>
    <language>en</language>
    <item>
      <title>How to Add an Indian Calendar Widget to Any Website (Free iframe, Hindi and English)</title>
      <dc:creator>Bijay Thapa</dc:creator>
      <pubDate>Wed, 25 Nov 2026 06:50:40 +0000</pubDate>
      <link>https://dev.to/bijay_thapa_29fd55e45a027/how-to-add-an-indian-calendar-widget-to-any-website-free-iframe-hindi-and-english-4ae6</link>
      <guid>https://dev.to/bijay_thapa_29fd55e45a027/how-to-add-an-indian-calendar-widget-to-any-website-free-iframe-hindi-and-english-4ae6</guid>
      <description>&lt;p&gt;If your site serves an Indian audience (a temple committee, a Hindi news portal, a school, a community association abroad) someone will eventually ask for "today's tithi" or "the festival list" on the home page. Building that yourself means panchang calculations, festival rules that differ by region, and Hindi translations. For most sites that is weeks of work for one sidebar box.&lt;/p&gt;

&lt;p&gt;The shortcut is an iframe. This post walks through the free [&lt;a href="https://indian-calendar.com/widgets" rel="noopener noreferrer"&gt;Indian calendar widget&lt;/a&gt;]() from Indian Calendar: the three widget types, the URL parameters, one encoding mistake that silently breaks the colour, and drop-in code for plain HTML, React and WordPress.&lt;/p&gt;

&lt;p&gt;Disclosure: I work with the Indian Calendar team. Everything below was tested against the live widget URLs in November 2026.&lt;/p&gt;

&lt;h3&gt;
  
  
  What you can embed
&lt;/h3&gt;

&lt;p&gt;There are three widgets, and each comes in English (&lt;code&gt;EN&lt;/code&gt;) or Hindi (&lt;code&gt;HI&lt;/code&gt;).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Month calendar (&lt;code&gt;small_calendar&lt;/code&gt;)&lt;br&gt;
A month grid with the Gregorian date and the Bikram Sambat (B.S.) date in every cell, the tithi for each day, and the festivals and observances that fall on it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Today card (&lt;code&gt;today_card&lt;/code&gt;)&lt;br&gt;
A compact card with today's date in both systems, the tithi and the day's events. On 25 November 2026 it showed Mangsir 9, 2083 B.S., Pratipada as the tithi, and Margashirsha Begins (North), Rohini Vrat and Ishti underneath. It also has a slimmer version without the event list.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Date converter (&lt;code&gt;date_converter&lt;/code&gt;)&lt;br&gt;
A small form that converts B.S. to A.D. and back. It is the same tool as the full-page &lt;a href="https://indian-calendar.com/date-converter" rel="noopener noreferrer"&gt;Vikram Samvat to Gregorian converter&lt;/a&gt;, shrunk to fit a sidebar.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The calendar data updates on its own. You paste the code once and never touch it again.&lt;/p&gt;

&lt;h4&gt;
  
  
  The basic embed
&lt;/h4&gt;

&lt;p&gt;This is the whole thing for a month calendar in English:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt;
  &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"https://indian-calendar.com/widgets/small_calendar?language=EN&amp;amp;color=%23D88115"&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Indian Calendar month view"&lt;/span&gt;
  &lt;span class="na"&gt;loading&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"lazy"&lt;/span&gt;
  &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"width:100%; max-width:410px; height:550px; border:none;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/iframe&amp;gt;&lt;/span&gt;`
```



Three details in there are worth keeping:

- `title` is what screen readers announce for the frame. Describe the content, not "iframe".

- `loading="lazy"` stops the browser fetching the widget until the visitor scrolls near it. If the calendar sits below the fold, this keeps it out of your page's first load.

- `width:100%` with a `max-width` makes the frame shrink on phones and stop growing on desktop.

The colour gotcha: encode the `#`

This one cost me ten minutes. If you write the colour the way you would in CSS:



```html
&lt;span class="c"&gt;&amp;lt;!-- Wrong: the colour never reaches the widget --&amp;gt;&lt;/span&gt;
src="https://indian-calendar.com/widgets/today_card?language=EN&amp;amp;color=#B03A2E"
```



the browser treats everything after `#` as a URL fragment. Fragments are never sent to the server, so the widget gets no colour at all and falls back to its default. Encode the hash as `%23`:



```html
&lt;span class="c"&gt;&amp;lt;!-- Right --&amp;gt;&lt;/span&gt;
src="https://indian-calendar.com/widgets/today_card?language=EN&amp;amp;color=%23B03A2E"
```



If you build the URL in JavaScript, `URLSearchParams` or `encodeURIComponent('#B03A2E')` handles this for you.

## Show a fixed month

By default the month calendar opens on the current month. To pin a specific month, say for an event page that should always show the festival month, put the B.S. year and month in the path:



```html
&lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt;
  &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"https://indian-calendar.com/widgets/small_calendar/bs/2083-09?language=EN&amp;amp;color=%23D88115"&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Indian Calendar, Poush 2083"&lt;/span&gt;
  &lt;span class="na"&gt;loading&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"lazy"&lt;/span&gt;
  &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"width:100%; max-width:410px; height:550px; border:none;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/iframe&amp;gt;&lt;/span&gt;
```



`2083-09` is Poush 2083, which runs from mid-December 2026 to mid-January 2027.

## React and Next.js component

A small wrapper keeps the sizes and the encoding in one place:



```jsx
const SIZES = {
  small_calendar: { maxWidth: 410, height: 550 },
  today_card: { maxWidth: 410, height: 220 },
  date_converter: { maxWidth: 300, height: 250 },
};

export default function IndianCalendarWidget({
  type = 'small_calendar',
  language = 'EN',
  color = '#D88115',
  showEvents = true,
}) {
  const params = new URLSearchParams({ language, color }); // encodes # as %23
  const slim = type === 'today_card' &amp;amp;&amp;amp; !showEvents;
  if (slim) params.set('show_events', 'false');

  const { maxWidth, height } = SIZES[type];

  return (
    &lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt;
      &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;`https://indian-calendar.com/widgets/$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="na"&gt;?$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;params&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="na"&gt;`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Indian Calendar widget"&lt;/span&gt;
      &lt;span class="na"&gt;loading&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"lazy"&lt;/span&gt;
      &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;{{&lt;/span&gt;&lt;span class="na"&gt; width: '100%', maxWidth, height: slim ? 150 : height, border: 'none' &lt;/span&gt;&lt;span class="k"&gt;}}&lt;/span&gt;
    &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  );
}
```



Usage:



```jsx
&lt;span class="nt"&gt;&amp;lt;IndianCalendarWidget&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"today_card"&lt;/span&gt; &lt;span class="na"&gt;language&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"HI"&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"#7A1F1F"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;IndianCalendarWidget&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"date_converter"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
```



It works the same in a Next.js server component, because nothing in it runs in the browser.

## WordPress, Wix, Blogger and other site builders

1. Add a **Custom HTML** block (WordPress) or an **Embed / HTML** element (Wix, Squarespace, Webflow, Blogger gadget).
2. Paste the iframe code from above.
3. Preview on a phone. If the widget sits in a narrow sidebar, the today card or the converter fits better than the month grid.

If you want to skip the parameters, the [widget builder page](https://indian-calendar.com/widgets) has a colour picker and a copy button for every variant.

## If your site has a Content Security Policy

A strict CSP blocks third-party frames. Add the widget domain to `frame-src`:



```http
Content-Security-Policy: frame-src 'self' https://indian-calendar.com;
```



If you see a blank box and a CSP error in the console, this is the cause.

## When an iframe is the wrong choice

An iframe gives you a finished, styled box. You can't read the tithi into your own code, restyle individual cells or trigger something when it's Ekadashi. If you need the data itself, for reminders, filters or your own layout, use a panchang library or an API instead.

For "show today's date, tithi and festivals on our site", the iframe is the least code you will write.

## Quick checklist

1. Pick the widget: month calendar, today card or converter.
2. Pick `EN` or `HI`.
3. Encode your colour as `%23RRGGBB`.
4. Set the height from the size table.
5. Add `title` and `loading="lazy"`.
6. Allow `https://indian-calendar.com` in `frame-src` if you use a CSP.

If you embed it somewhere, drop a link in the comments. I'd like to see how it looks on different sites.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>webdev</category>
      <category>calendar</category>
      <category>widgets</category>
    </item>
  </channel>
</rss>
