Skip to content

Mark a calendar template with colors for Lunar phases (Buddhist Uposatha days)

Notifications You must be signed in to change notification settings

chang-zhao/calen

Repository files navigation

Buddhist Lunar calendar

Suppose we have an empty calendar template (html) for a certain year:

year.html

empty calendar template

We want to make a calendar colored with Lunar phases (Buddhist Uposatha days).

Buddhist Uposatha days traditionally are 6 days in every Lunar month:

  • 2 days of New Moon,
  • 2 days of Full Moon,
  • Two quarters, 1 day each.

So we take a text file which lists moon phases for that year.

dates.txt

The program reads both files and creates a calendar filled with colors.

ready calendar

Input files:

  • year.html - calendar template for the year
  • dates.txt - data on moon phases

Output: calendar for the year with moon phases.

Program files:

  • index.php - original version, with step-by-step comments for easy modification
  • index1.php - optimized version, less comprehensible

If your input files are of different data format, you would need to change patterns for search & replace, and maybe something else!

For info:

Let all sentient beings be truly happy, free from suffering and causess of suffering!

About

Mark a calendar template with colors for Lunar phases (Buddhist Uposatha days)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published