CelestialCalendar 1.0.0 · unreleased development @ 67a7c4c79a4a4a6aa7e703c9e6f0039ae34bee82
Loading...
Searching...
No Matches
calendar::lunar::algo1 Namespace Reference

Functions

auto calc_lunar_year (int32_t year) -> common::LunarYear
 Calculate the lunar year information for the given year.

Variables

constexpr int32_t START_YEAR
 The first supported lunar year.
constexpr int32_t END_YEAR
 The last supported lunar year.
constexpr std::array< uint32_t,(END_YEAR - START_YEAR+1)> LUNAR_DATA
 The encoded binary data for each lunar year. Info for a year is stored in a uint32_t.
const auto bounds
 The bounds of the algorithm, i.e. the supported range of lunar and Gregorian dates.

Function Documentation

◆ calc_lunar_year()

auto calendar::lunar::algo1::calc_lunar_year ( int32_t year) ->common::LunarYear
inlinenodiscard

Calculate the lunar year information for the given year.

Attention
The input year should be in the range of [START_YEAR, END_YEAR].
Parameters
yearThe Lunar year. 阴历年份。
Returns
The lunar year information. 阴历年信息。

Variable Documentation

◆ bounds

const auto calendar::lunar::algo1::bounds
inline

The bounds of the algorithm, i.e. the supported range of lunar and Gregorian dates.

◆ END_YEAR

int32_t calendar::lunar::algo1::END_YEAR
inlineconstexpr

The last supported lunar year.

◆ LUNAR_DATA

std::array<uint32_t, (END_YEAR - START_YEAR + 1)> calendar::lunar::algo1::LUNAR_DATA
inlineconstexpr

The encoded binary data for each lunar year. Info for a year is stored in a uint32_t.

See also
https://www.hko.gov.hk/sc/gts/time/conversion.htm

All 199 words for 1901-2099 reproduce exactly from the retained HKO identity record in src/test/provenance/hko/2026-08-25/.

Note
Gregorian dates preserve HKO's published calendar labels, not a uniform historical time-zone rule. Known differences from algo2 are documented in src/test/lunar/diff_test.cpp (#64, #70). 公历日期保留香港天文台发布的日期标记,不代表统一的历史时区规则。 与 algo2 的已知差异见 src/test/lunar/diff_test.cpp(#64、#70)。
Retained under owner risk acceptance; upstream permission was not obtained and no permission is claimed. These HKO-derived words remain under their source terms and outside the project MIT grant.

◆ START_YEAR

int32_t calendar::lunar::algo1::START_YEAR
inlineconstexpr

The first supported lunar year.