Lunar calendar

A lunar calendar is a calendar based on the monthly cycles of the Moon's phases (synodic months, lunations), in contrast to solar calendars, whose annual cycles are based only directly on the solar year. The most commonly used calendar, the Gregorian calendar, is a solar calendar system that originally evolved out of a lunar calendar system. A purely lunar calendar is also distinguished from a lunisolar calendar, whose lunar months are brought into alignment with the solar year through some process of intercalation. The details of when months begin varies from calendar to calendar, with some using new, full, or crescent moons and others employing detailed calculations.
Since each lunation is approximately  days, it is common for the months of a lunar calendar to alternate between 29 and 30 days. Since the period of 12 such lunations, a lunar year, is 354 days, 8 hours, 48 minutes, 34 seconds (354.36707 days), purely lunar calendars are 11 to 12 days shorter than the solar year. In purely lunar calendars, which do not make use of intercalation, like the Islamic calendar, the lunar months cycle through all the seasons of a solar year over the course of a 33-34 lunar-year cycle.
Although the Gregorian calendar is in common and legal use in most countries, traditional lunar and lunisolar calendars continue to be used throughout the world to determine religious festivals and national holidays. Such holidays include Rosh Hashanah (Hebrew calendar); Easter (the Computus); the Chinese, Japanese, Korean, Vietnamese, and Mongolian New Year (Chinese, Japanese, Korean, Vietnamese, and Mongolian calendars, respectively); the Nepali New Year (Nepali calendar); the Mid-Autumn Festival and Chuseok (Chinese and Korean calendars); Loi Krathong (Thai calendar); Sunuwar calendar; Vesak/Buddha's Birthday (Buddhist calendar); Diwali (Hindu calendars); Ramadan, Eid al-Fitr and Eid al-Adha (Islamic calendar).
History.
A lunisolar calendar was found at Warren Field in Scotland and has been dated to , during the Mesolithic period. Some scholars argue for lunar calendars still earlier—Rappenglück in the marks on a  year-old cave painting at Lascaux and Marshack in the marks on a  year-old bone baton—but their findings remain controversial. Scholars have argued that ancient hunters conducted regular astronomical observations of the Moon back in the Upper Palaeolithic. Samuel L. Macey dates the earliest uses of the Moon as a time-measuring device back to 28,000-30,000 years ago.
Lunisolar calendars.
Most calendars referred to as "lunar" calendars are in fact lunisolar calendars. Their months are based on observations of the lunar cycle, with intercalation being used to bring them into general agreement with the solar year. The solar "civic calendar" that was used in ancient Egypt showed traces of its origin in the earlier lunar calendar, which continued to be used alongside it for religious and agricultural purposes. Present-day lunisolar calendars include the Chinese, Vietnamese, Hindu, and Thai calendars.
Synodic months are 29 or 30 days in length, making a lunar year of 12 months about 11 to 12 days shorter than a solar year. Some lunar calendars do not use intercalation, for example the lunar Hijri calendar used by most Muslims. For those that do, such as the Hebrew calendar, and Buddhist Calendars in Myanmar, the most common form of intercalation is to add an additional month every second or third year. Some lunisolar calendars are also calibrated by annual natural events which are affected by lunar cycles as well as the solar cycle. An example of this is the lunar calendar of the Banks Islands, which includes three months in which the edible palolo worms mass on the beaches. These events occur at the last quarter of the lunar month, as the reproductive cycle of the palolos is synchronized with the moon.
Start of the lunar month.
Lunar and lunisolar calendars differ as to which day is the first day of the month. In some lunisolar calendars, such as the Chinese calendar, the first day of a month is the day when an astronomical new moon occurs in a particular time zone. In others, such as some Hindu calendars, each month begins on the day after the full moon. Others are based on the first sighting of the lunar crescent, such as the lunar Hijri calendar (and, historically, the Hebrew calendar).
Length of the lunar month.
The length of each lunar cycle varies slightly from the average value. In addition, observations are subject to uncertainty and weather conditions. Thus to avoid uncertainty about the calendar, there have been attempts to create fixed arithmetical rules to determine the start of each calendar month.
The average length of the synodic month is 29.53059 days. Thus it is convenient if months generally alternate between 29 and 30 days (sometimes termed respectively ""hollow" and "full""). The distribution of "hollow" and "full" months can be determined using continued fractions, and examining successive approximations for the length of the month in terms of fractions of a day.
In the table below, the first column gives a sequence of such continued fractions. So to devise a calendar from each, one would take the number of days as given in the numerator and divide it into the number of months as given in the denominator. The second column shows, for reference, the time length of that cycle in years and days. The next double column shows how many of the months must be full and how many must be hollow; in each case, there is only one possible combination (how they are ordered within the cycle is not relevant).
The next column shows the decimal value of each fraction; that is the effective average length of a month over one cycle. It will be noted that each successive value comes closer to the length of the synodic month. Finally, the last two columns show roughly how long it will take (assuming one adheres to the pattern exactly) for the calendar months to be about a day off the synodic month, and which way off it will be.
These fractions can be used to construct a lunar calendar, or in combination with a solar calendar to produce a lunisolar calendar. A 49-month cycle was proposed as the basis of an alternative Easter computation by Isaac Newton around 1700. The tabular Islamic calendar's 360-month cycle is equivalent to 24 of the cycles, minus a correction of one day. It comes to 10,631 days (29 years, including 7 leap years + 39 days) with 191 months of 30 days and 169 months of 29 days.