Icyn Date

v0.1.5
io.github.icyn12-tinker/icyn-date Checked 3 days ago Published 2 months ago

Date context for agents: Chinese lunar calendar, solar terms, holidays for 12 regions.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

date_context

Everything known about one date in one region: weekday/ISO week, workday status with source & confidence, holiday, lunar date & 干支, current/next solar term.

ParameterTypeDescription
date *stringISO date YYYY-MM-DD
langstring
regionstringRegion code, case-insensitive: CN HK MO TW JP KR VN SG US GB DE FR, or a subdivision like US-CA, DE-BY, GB-SCT

is_workday

Is this date a working day in the region? Answers carry source (official/baseline/predicted) and confidence.

ParameterTypeDescription
date *stringISO date YYYY-MM-DD
regionstringRegion code, case-insensitive: CN HK MO TW JP KR VN SG US GB DE FR, or a subdivision like US-CA, DE-BY, GB-SCT

holidays

List public holidays of a region for a year, or within a date range.

ParameterTypeDescription
fromstringISO date YYYY-MM-DD
regionstringRegion code, case-insensitive: CN HK MO TW JP KR VN SG US GB DE FR, or a subdivision like US-CA, DE-BY, GB-SCT
toISO date YYYY-MM-DD
yearinteger

workdays

Workday arithmetic: list or count workdays in a range, or move N workdays from a date (negative = backwards).

ParameterTypeDescription
from *stringISO date YYYY-MM-DD
addintegerMove this many workdays from `from` instead of listing a range
regionstringRegion code, case-insensitive: CN HK MO TW JP KR VN SG US GB DE FR, or a subdivision like US-CA, DE-BY, GB-SCT
toISO date YYYY-MM-DD

next_long_weekend

Next stretch of at least N consecutive non-working days from a date (holiday + weekend runs).

ParameterTypeDescription
from *stringISO date YYYY-MM-DD
minDaysinteger
regionstringRegion code, case-insensitive: CN HK MO TW JP KR VN SG US GB DE FR, or a subdivision like US-CA, DE-BY, GB-SCT

holiday_eve

Is this date the last working day before a public holiday?

ParameterTypeDescription
date *stringISO date YYYY-MM-DD
regionstringRegion code, case-insensitive: CN HK MO TW JP KR VN SG US GB DE FR, or a subdivision like US-CA, DE-BY, GB-SCT

lunar

Convert a solar date to the Chinese lunar calendar (year/month/day, leap month, 干支, zodiac), or a lunar date to solar.

ParameterTypeDescription
datestringISO date YYYY-MM-DD
lunarobject

next_lunar_date

Next solar date on which a lunar month/day occurs (e.g. a lunar birthday or 中秋 8/15).

ParameterTypeDescription
day *integer
from *stringISO date YYYY-MM-DD
month *integer

solar_terms

The 24 solar terms (节气) of a year with exact instants (UTC).

ParameterTypeDescription
year *integer

regions_observing

Which regions take a canonical festival off in a given year (e.g. lunar-new-year, mid-autumn, christmas), and on which dates.

ParameterTypeDescription
festival *stringOne of: all-saints, armed-forces-day, armistice, ascension, assumption, autumnal-equinox, bank-holiday, boxing-day, childrens-day, christmas, columbus-day, coming-of-age, constitution-day, culture-day…
year *integer

regions

Supported regions, subdivisions, data coverage and data version.