DEV Community

Cover image for Hindu Festival Tithi Rules
Adi Kumar
Adi Kumar

Posted on

Hindu Festival Tithi Rules

I was migrating our regional calendar pages from hand-coded festival dates to engine-computed ones when I noticed Bhai Dooj 2026 was showing November 11. I checked it against a couple of published panchangs. Both said November 10.

The festival was off by a day. The fix turned out to be two lines, and those two lines are agreeing with a body of seventeenth-century Sanskrit law that said this question would come up and answered it in advance.

A tithi is not a day.

A tithi is the duration during which the Moon moves twelve degrees of longitude away from the Sun. The Moon's orbit is elliptical, so the duration isn't constant. It varies between about twenty hours at the fastest and twenty-seven at the slowest. The average is twenty-three hours and thirty-seven minutes. Almost never a clean multiple of the solar day.

So a tithi spans, on most days, two Gregorian dates. It begins partway through one day, runs across the night, ends partway through the next.

For someone computing when a festival happens, this is the central problem. Bhai Dooj is observed on Kartika Shukla Dwitiya. In November 2026, Dwitiya begins at 2:00 PM IST on Tuesday the 10th and ends at 3:53 PM on Wednesday the 11th. Both days have Dwitiya in them. Neither has it the whole way through. Which is the Bhai Dooj day?

The Sanskrit legal tradition has a name for this question. Kala-vyapti, time-prevalence. A festival has a designated time window during the day, and the tithi has to be present (vyapta) during that window for the rite to be observed on that day. The windows aren't arbitrary. Each one maps to the time of day when the festival's central act is supposed to happen.

  1. Diwali is observed when Amavasya is present in pradosh, the ninety-six minutes after sunset, because the Lakshmi Puja happens at twilight.

  2. Maha Shivaratri is observed when Chaturdashi is present in nishita, around midnight, because the rite is the night vigil.

  3. Ram Navami is observed when Navami overlaps madhyahna, the third fifth of daytime, because Ram is said to have been born at noon.

  4. Bhai Dooj is observed when Dwitiya is present in aparahna, the fourth fifth of daytime, mid-to-late afternoon, because the rite is the sister's visit and the tilak.

Our code didn't have this layer for Bhai Dooj.

The festival definition was this:

{ masa: 'kartika', paksha: 'shukla', tithi: 2, slug: 'bhai-dooj',
  type: 'major', category: 'festival' }
Enter fullscreen mode Exit fullscreen mode

No muhurta rule. When the field is absent, our engine defaults to the sunrise rule, which is the most common one. For most festivals that default is right. For Bhai Dooj it isn't.

At Tuesday's sunrise (06:40 IST in Delhi), Dwitiya hasn't started yet. At Wednesday's sunrise, Dwitiya is active. Sunrise rule picks Wednesday. The engine returned November 11.

The aparahna rule asks a different question. Was Dwitiya present in Tuesday afternoon? Yes, from 2:00 PM onward, ending at sunset. Wednesday afternoon? Yes, until 3:53 PM. Both days have Dwitiya in the aparahna window. So a tie-break has to choose.

The classical jurists sorted tie-breaks into purva-vyapini (first-day-prevailing), para-vyapini (second-day-prevailing), and ubhaya-vyapini (a small family of both-day compromise rules). Each major festival has its assignment worked out somewhere in the medieval legal corpus.

This is the uncontroversial part. The classical literature is unambiguous that Bhai Dooj attaches to the aparahna kaal, not to sunrise. Dharmasindhu (1790) says so. Nirnayasindhu (1612) says so. Hemādri (13th century) says so. Every published Indian panchang that displays a muhurat time for Bhai Dooj displays the aparahna window. The rule itself isn't contested.

What's contested is what to do when the tithi is present in the aparahna window on both candidate days.

For November 2026, Dwitiya enters Tuesday the 10th's aparahna window late — around 2:00 PM, with aparahna ending near 3:20 PM. That's about eighty minutes of overlap. Dwitiya then spans the entire aparahna window on Wednesday the 11th — full sunrise-to-3:20 PM presence, with aparahna ending at 3:20 PM and Dwitiya itself ending at 3:53 PM. About a hundred and thirty minutes of overlap. Both days qualify under the bare rule. The tie-break decides which one wins.

The classical jurists sorted tie-breaks into three families.

Pūrva-vyāpinī. First-touch. If the tithi is present in the window on Day 1 at all, even briefly, observe on Day 1.

Para-vyāpinī. Second-day. The opposite reading: if the tithi extends into Day 2's window at all, observe on Day 2.

Bhūyo-vyāpinī. Majority-span. Observe on whichever day the tithi occupies the larger fraction of the window. The window itself is what's being measured — whichever day the tithi covers more of it.

Each major festival has its tie-break assignment worked out in the medieval legal corpus. For some festivals there's no real disagreement. Pradosh-vyāpinī Amavasya for Diwali, for instance — every lineage agrees this is pūrva-vyāpinī, because by Day 2's pradosh the new lunar day has effectively begun in the lunar-day sense. Nishita-vyāpinī Chaturdashi for Maha Shivaratri is the same — pūrva-vyāpinī, no contest.

For Bhai Dooj's aparahna-vyāpinī Dwitiya, the lineages disagree. The Maharashtrian Dharmasindhu lineage reads it as pūrva-vyāpinī — if Dwitiya enters Day 1's aparahna at all, Day 1 wins. The broader Nirnayasindhu tradition that the mainstream Indian panchang ecosystem follows reads it as bhūyo-vyāpinī — the day with majority aparahna-overlap wins. November 2026 is exactly the year these two readings disagree.
Both are classical. Both are textually defended. Neither is "the bug."

So the second change was the tie-break logic:

if (overlap1 > 0 && overlap2 === 0) {
  // Day 1 wins
} else if (overlap1 > 0 && overlap2 > 0) {
  if (['pradosh', 'nishita'].includes(rule) || overlap1 >= overlap2) {
    // Day 1 wins
  }
  // else Day 2 wins (bhūyo-vyāpinī default)
}
Enter fullscreen mode Exit fullscreen mode

pradosh and nishita are on the priority list because they actually are pūrva-vyāpinī by classical consensus — the night portion of Day 1 is the "real" night for the lunar day; Day 2's same window has already moved past it. aparahna is not on that list, because it's the contested one, and the mainstream reading takes the bhūyo-vyāpinī path.

For Bhai Dooj 2026, the math runs:

Tuesday Nov 10: Dwitiya in aparahna ≈ 80 minutes (overlap1)
Wednesday Nov 11: Dwitiya in aparahna ≈ 130 minutes (overlap2)
Neither rule is in the pūrva-vyāpinī priority list. overlap1 < overlap2.
Day 2 keeps the date. November 11.

For Bhai Dooj, the authoritative source is Kashinatha Upadhyaya's Dharmasindhu, completed in 1790. Kashinatha was a Maharashtrian jurist whose treatise became the late-classical standard for festival timing across most of North India. His rule for Bhai Dooj is that if Dwitiya is present in the aparahna kaal on the first of the two candidate days, the festival is observed on that first day, regardless of how much overlap the second day has.

Purva-vyapini, applied to aparahna.

Our engine's tie-break was doing something close to this but not quite. It had pradosh and nishita hardcoded into a first-day-prevailing branch, because those are the most common purva-vyapini windows. Aparahna wasn't on the list. When both days had aparahna overlap, the engine fell through to a default: pick whichever day had more overlap. Wednesday's window covered 132 minutes; Tuesday's was 80. Wednesday won.

One field on the definition. One string in the tie-breaker array.

What sits underneath the fix is that the festival defs in our codebase aren't really configuration data. They're closer to a transcription of medieval Sanskrit jurisprudence into a different notation. When the muhurta field is absent and the tie-break list is incomplete, what's actually wrong is the transcription. The verses haven't changed. The code's job is mostly to catch up to them.

The Dharmasindhu has been on shelves for centuries. Two and a half centuries is a long time to be off by a day.


https://dekhopanchang.com?utm_source=devto&utm_medium=article&utm_campaign=festival-rules

Top comments (0)