Skip to main content

Crate holiday_engine

Crate holiday_engine 

Source
Expand description

§holiday-engine

Chinese statutory holiday data for 2026 (officially published) and 2027 (estimated based on lunar calendar).

Covers all 7 Chinese statutory holidays plus their adjusted work days (調休). Updated annually when the State Council releases next year’s schedule.

§The data

Holiday2026 RangeDaysNotes
元旦 New YearJan 11
春节 Spring FestivalFeb 15-217+2 adjusted work days
清明节 QingmingApr 5-62
劳动节 Labour DayMay 1-55+1 adjusted
端午节 Dragon BoatJun 19-213
中秋节 Mid-AutumnSep 25-27*3Sep 27 overwritten by National Day adjustment
国庆节 National DayOct 1-77+2 adjusted

§Quick start

use holiday_engine::{get_china_holidays, is_naturally_off};
use chrono::NaiveDate;

let holidays = get_china_holidays();
let date = NaiveDate::from_ymd_opt(2026, 1, 1).unwrap();
assert!(is_naturally_off(date, &holidays));

// Feb 14, 2026 is a Saturday but an adjusted WORK day
let work_date = NaiveDate::from_ymd_opt(2026, 2, 14).unwrap();
assert!(!is_naturally_off(work_date, &holidays));

Structs§

HolidayInfo
Information about a holiday or adjusted work day.

Functions§

get_china_holidays
Get all Chinese statutory holidays and adjusted work days.
is_naturally_off
Returns true if the date is “naturally off”:
is_weekend
Returns true if the date is a weekend (Saturday or Sunday).