bhaddacak.github.io

Thai Holy Days

Sun Mon Tue Wed Thu Fri Sat

Stand-alone version

As seen above, the limitation of the website’s theme makes the program difficult to write. So, it is preferable to use this stand-alone version.

Apart from a different design, this version gives you more information in both Thai and English. The program is self-contained and ready to run everywhere that has a JavaScript-enabled web browser. This is an ideal cross-platform application, the smallest and fastest of its kind.

To use the program in your device, go to the page above, save it to your device and open it with a web browser. For future uses, you may need to set a bookmark for it.

Here are abbreviations shown in the program:

Colors used in normal day-mode display are:

For simplicity, the program computes and shows only the days marked as holy, i.e., new-moon day (15- or 14-), waxing half-moon day (8+), full-moon day (15+), and waning half-moon day (8-). For other days, you have to make your own simple count from known days nearby.

In the context of Node.js

The calculating engine of the program can be used with Node.js. If you have this installed, copy thaiholydays.js to your place and type this command for help and follow what is guided:

$ node thaiholydays.js -h

In this context, you do not get calendar view, but instead just a list of days. However, you can either list one month at a time or a whole year.

To use as an API

You can use the engine in your program by studying the stand-alone version mentioned above as an example. In fact, the calculation part is really small. The main work is about the display.

The main functions you can use in this case are thaiHolyDays.computeMonth(dateInput) and thaiHolyDays.computeYear(dateInput). The former gives you a list of the specific month, the later the whole year of it. The argument dateInput is a string as you enter in the Node context. It is simply in YYYY-MM or YYYYMM format. A result of the functions is like an array exemplified below (from thaiHolyDays.computeMonth("2025-01")):

[
  { thaimonth: '2', thaiday: '8+', date: 2025-01-06T00:00:00.000Z },
  { thaimonth: '2', thaiday: '15+', date: 2025-01-13T00:00:00.000Z },
  { thaimonth: '2', thaiday: '8-', date: 2025-01-21T00:00:00.000Z },
  { thaimonth: '2', thaiday: '15-', date: 2025-01-28T00:00:00.000Z }
]

A minimum explanation

Thai lunar calendar is a messy topic. I do not want to go deep in this issue. But the calendar is really indispensable to Thai culture, especially parts related to Buddhism. Buddhists have to know when to go to temples or when to celebrate an important Buddhist day, such as Vesak (full-moon of lunar month 6).

As monks, we have to know the time of the Vassa (rain-retreat), when to shave our head (Thai monks shave their head on the day before full-moon. Some do it on the day before new-moon as well.), or when to gather in Pāṭimokkha recitation (in full-moon and new-moon day).

When “holy days” is used here, it is not meant to be sacred in any way (but these days are often taken as auspicious). By holy I mean simply religion-related. In each month we normally have 4 days of these, or (rarely) 5 days. Devout Buddhists go to temples on these occasions. The days are marked by lunar calendar.

Whereas the real calculation is too difficult to talk about, the basic idea is quite simple. As a matter of fact, days counted by the moon cycles are not equal to days calculated by the orbit of the sun. Normally, 12 lunar cycles make around 354 days, and the sun goes roughly 365 days a cycle. To use the two systems together, we have to find a way to align them.

Here is the Thai method. In a regular year, even lunar months have 30 days each, and odd lunar months have 29 days (6*30 + 6*29 = 354). Every 2-3 years or so, an extra month (adhikamāsa) have to be added. This makes that year have 13 months or 384 days totally. Traditionally, month 8 is doubled and we normally see the latter 8 as 88 in calendars of that year. In Buddhist context, the Vassa starts after the full-moon of month 8. In the case of 13-month years, the Vassa starts in month 88 instead.

That is not enough to make the alignment. Every 5-6 years or so, an extra day (adhikavāra) have to be added also. (By principle, the extra day will not be added in extra-month years.) In this case, the year has 355 days. And the extra day will be added to month 7, making it 30 days that year. (In a normal odd month, it has only 14 waning-moon day. In this case, it also has 15 waning-moon day.)

The hard problem of the whole matter is when to put the extra day (and the extra month, in a lesser degree). Historically speaking, we have had many methods to treat this, and disagreements abounded. What makes this difficult is that the problem is not so completely scientific that it can be solved with calculation alone. This involves a kind of personal judgment. Formally, we have to wait for the announcement from Thai Royal Astronomers for problematic cases.

Now come to our program. Formerly, I created a simple program to use personally with data calculated by spreadsheets, and I updated the data every 10 years. When my difficult works have been settled, I had time to rewrite the program. The calculation is simple because I do not do the hard things. The main data come from calculations done by Loy Chunpongthong in Astronomical and Mathematical Thai Calendar printed by the National Astronomical Research Institute of Thailand (NARIT).1

The substantial data taken are years marked by the extra-day, and, in a lesser extent, years marked by the extra-month. By the range of the calendar (around 200 years), we mostly can calculate the extra-month years by metonic-cycle number. Only 10 years defy the calculation, so I took the data directly. (For the details, please study the program.)

Please also remember that calendar is an approximation. The real full moon may be off by a day or two comparing to the calendar. If you need precise information, please use a proper scientific calculation.

To conclude, this will be the last rewrting of the program because its data now covers my lifespan and much more. By its reliability, I think it is unlikely that we will have to fix the data. But the future is really uncertain. When some discrepancies occur, however, the program is now easy to learn and fix because we really do not have real calculation here.

  1. ลอย ชุนพงษ์ทอง, ปฏิทินไทย เชิงดาราศาสตร์ และคณิตศาสตร์, กรุงเทพ: สถาบันวิจัยดาราศาสตร์แห่งชาติ, ๒๕๕๐ (2007).