thai_holidays 0.1.0 copy "thai_holidays: ^0.1.0" to clipboard
thai_holidays: ^0.1.0 copied to clipboard

Pure-Dart Thai public-holiday calendar: fixed and movable Buddhist holidays, in-lieu days, special bridge days, and business-day helpers.

Changelog #

0.1.0 #

Initial release.

Holidays #

  • Fixed-date Thai public holidays (New Year, Chakri, Songkran ×3, Labour Day, Coronation Day, royal birthdays, Chulalongkorn Day, memorial days, Constitution Day, New Year's Eve), with historical effective-year gating:
    • King Vajiralongkorn's Birthday (28 Jul) — from 2017.
    • King Bhumibol Memorial Day (13 Oct) — from 2017.
    • Coronation Day (4 May) — from 2019.
    • Queen Suthida's Birthday (3 Jun) — from 2019.
  • Movable Buddhist holidays computed via thai_lunar: Makha Bucha, Visakha Bucha, Asalha Bucha, and Khao Phansa — including the athikamat (double-eighth-month) leap-year month shift.
  • Cabinet-announced special ("bridge") holidays, seeded per year and current through 2026: 2023 (5 May, 31 Jul), 2024 (12 Apr, 30 Dec), 2025 (2 Jun, 11 Aug), 2026 (2 Jan). Sources: Thai cabinet resolutions (มติ ครม.) / PRD / ThaiPBS, cross-checked against the vacanza/holidays Thailand provider.
  • Royal Ploughing Ceremony (วันพืชมงคล), a government-only holiday announced annually; seeded for 2024 (10 May), 2025 (9 May), 2026 (13 May). Sources: Nation Thailand, PublicHolidays.asia, Thaiger, Thailand NOW.
  • Stack-aware in-lieu (substitution) days for holidays that fall on a weekend; an in-lieu day carries the id and bankHoliday flag of the holiday it observes.

API #

  • ThaiHolidayId enum + ThaiHoliday.id — stable, locale-independent identifier (avoids string-matching localized names).
  • ThaiHoliday.bankHoliday (bool) — distinguishes the government public-holiday list from the Bank of Thailand bank-holiday list. false for Khao Phansa and the Royal Ploughing Ceremony (government holidays that banks do not observe).
  • ThaiHoliday.name({bool thai = true}) — locale selector.
  • holidayOn(DateTime) / holidaysOn(DateTime) — point queries.
  • thaiHolidaysBetween(start, end, {includeSubstitution}) — range query across year boundaries.
  • Business-day helpers: isBusinessDay, nextBusinessDay, addBusinessDays (supports negative n), and businessDaysBetween (half-open (a, b]).

Notes #

  • All dates are UTC, date-only.
  • Supported range: accurate from ~2017 onward and current through 2026 for annually-announced entries (special bridge days and Royal Ploughing). Earlier years are approximate; future years are added as their dates are officially announced. See NOTICE.md.
  • Lunar dates are computed via the thai_lunar engine (^0.1.0).
0
likes
160
points
37
downloads

Documentation

API reference

Publisher

verified publisher10v3n4m.cc

Weekly Downloads

Pure-Dart Thai public-holiday calendar: fixed and movable Buddhist holidays, in-lieu days, special bridge days, and business-day helpers.

Repository (GitHub)
View/report issues

Topics

#thai #holiday #calendar #buddhist #date

License

MIT (license)

Dependencies

thai_lunar

More

Packages that depend on thai_holidays