A calendar is a system of arranging days according to astronomical events for regulating everyday life. The traditional Chinese calendar is known as the Agricultural Calendar or Nongli, as the calendar divides the year into seasons for agriculture, which is the principal economy of the country.
Calendars that are based on the moon's orbit around the Earth are known as lunar calendars (Yinli). Solar calendars (Yangli) are another category of calendars that are based on the positions of the Sun through the seasons. The Agricultural Calendar is an integrated lunar-solar calendar (Yinyangli) as it embraces the movement of the moon as well as that of the Sun.
"Tropical year" and "synodic month" are the basic elements of the Agricultural Calendar. A tropical year is the time from a vernal equinox to the next, which is 365.2422 days (365 days 5 hours 48 minutes and 46 seconds). The time between two successive occurrences of new moon or full moon is called a synodic month, and equals 29.5306 days (29 days 12 hours 44 minutes 3 seconds).
In ancient time, observation of moon phases (i.e., new moon > first quarter > full moon > last quarter > new moon) is a convenient way to count the days. Months in the Agricultural Calendar start with a new moon, which occurs when the moon and the Sun move to the same longitude on the ecliptic. Solar eclipses always fall on the first day of a month in the Agricultural Calendar. Lunar eclipses always coincide with the full moon phases when the longitudes of the moon and the Sun on the ecliptic differ by 180 degrees.
There are only 354.3672 days in 12 synodic months, more than 10 days shorter than a tropical year (365.2422 days). The difference accumulates to give a leap month. Back to 5 or 6 century B.C., the Metonic cycle of 7 leap months in 19 years was already adopted in the Agricultural Calendar.