Expand description
Chinese-like lunar calendars (Chinese, Dangi)
StructsΒ§
- Chinese
- A type implementing
ChineseBased
for the Chinese calendar - Chinese
From Fixed Result - chinese_based_date_from_fixed returns extra things for use in caching
- Dangi
- A type implementing
ChineseBased
for the Dangi (Korean) calendar - Year
Bounds - Marks the bounds of a lunar year
ConstantsΒ§
- CHINESE_
EPOCH π - CHINESE_
EPOCH_ πISO - CHINESE_
LOCATION_ πPOST_ 1929 - CHINESE_
LOCATION_ πPRE_ 1929 - FIXED_
1908 π - FIXED_
1912 π - FIXED_
1954 π - FIXED_
1961 π - KOREAN_
ELEVATION π - KOREAN_
EPOCH π - KOREAN_
EPOCH_ πISO - KOREAN_
LATITUDE π - KOREAN_
LOCATION_ π1908 - KOREAN_
LOCATION_ π1912 - KOREAN_
LOCATION_ π1954 - KOREAN_
LOCATION_ π1961 - KOREAN_
LOCATION_ πORIGINAL - KOREAN_
LONGITUDE π - MAX_
ITERS_ πFOR_ MONTHS_ OF_ YEAR - UTC_
OFFSET_ π1908 - UTC_
OFFSET_ π1912 - UTC_
OFFSET_ π1954 - UTC_
OFFSET_ π1961 - UTC_
OFFSET_ πORIGINAL - The Korean Dangi calendar relies on knowing the current day at the moment of a new moon; however, this can vary depending on location. As such, new moon calculations are based on the time in Seoul. Before 1908, local time was used, represented as UTC+(3809/450 h). This changed multiple times as different standard timezones were adopted in Korea. Currently, UTC+9h is used.
- UTC_
OFFSET_ πPOST_ 1929 - UTC_
OFFSET_ πPRE_ 1929 - The Chinese calendar relies on knowing the current day at the moment of a new moon; however, this can vary depending on location. As such, new moon calculations are based on the time in Beijing. Before 1929, local time was used, represented as UTC+(1397/180 h). In 1929, China adopted a standard time zone based on 120 degrees of longitude, meaning from 1929 onward, all new moon calculations are based on UTC+8h.
TraitsΒ§
- Chinese
Based - The trait ChineseBased is used by Chinese-based calendars to perform computations shared by such calendar. To do so, calendars should:
FunctionsΒ§
- bind_
winter_ πsolstice - This function forces the RataDie to be on December 20, 21, 22, or 23. It was created for practical considerations and is not in the text.
- chinese_
based_ date_ from_ fixed - Get a chinese based date from a fixed date, with the related ISO year
- days_
in_ month - Returns the number of days in the given
month
after the givennew_year
. Also returns the RataDie of the new moon beginning the next month. - days_
in_ prev_ year - Given a new year, calculate the number of days in the previous year
- days_
in_ provided_ year - Calculated the numbers of days in the given year
- days_
until_ month - Given the new year and a month/day pair, calculate the number of days until the first day of the given month
- fixed_
mid_ year_ from_ year - Get a RataDie in the middle of a year.
- get_
leap_ month_ from_ new_ year - Given that
new_year
is the first day of a leap year, find which month in the year is a leap month. - is_
leap_ year - Whether this year is a leap year
- last_
month_ day_ in_ year - The last month and day in this year
- major_
solar_ πterm_ from_ fixed - Get the current major solar term of a fixed date, output as an integer from 1..=12.
- midnight π
- Universal time of midnight at start of a Momentβs day at the observation location
- month_
days - Returns the number of days in the given (year, month).
- month_
structure_ for_ year - Returns the length of each month in the year, as well as a leap month index (1-indexed) if any.
- new_
moon_ πbefore - The fixed date in standard time at the observation location of the previous new moon before a given Moment.
- new_
moon_ πon_ or_ after - The fixed date in standard time at the observation location of the next new moon on or after a given Moment.
- new_
year_ πin_ sui - Determines the fixed date of the lunar new year given the start of its corresponding solar year (ζ²), which is also the winter solstice
- new_
year_ πon_ or_ before_ fixed_ date - Get the fixed date of the nearest Lunar New Year on or before a given fixed date. This function also returns the solstice following a given date for optimization (see #3743).
- winter_
solstice_ πon_ or_ before - Get the fixed date of the nearest winter solstice, in the Chinese time zone, on or before a given fixed date.