thai_lunar 0.1.0
thai_lunar: ^0.1.0 copied to clipboard
Pure-Dart Thai lunar calendar: Gregorian conversion, athikamat/athikavar year types, and Buddhist holiday full moons (Makha, Visakha, Asalha).
Changelog #
0.1.0 #
Initial release. Pure-Dart, dependency-free Thai lunisolar calendar engine, ported from pythaidate (MIT © 2023 Mark Hollow).
- Gregorian <-> Thai lunar conversion (
gregorianToThaiLunar,thaiLunarToGregorian). - Lunar year classification:
lunarYearType,isAthikamat,isAthikavar(normal / athikavar / athikamat — 354 / 355 / 384 days). - Buddhist holiday full moons via
fullMoonOf(Makha, Visakha, Asalha), with the athikamat month shift and doubled-month-8 (secondEighth) support. - เสาร์ห้า (Sao Ha) finder:
isSaoHa,saoHaType(with theSaoHaTypemajor/minorgrades — เสาร์ห้าใหญ่ ขึ้น 5 ค่ำ vs เสาร์ห้าน้อย แรม 5 ค่ำ),saoHaDatesInandnextSaoHa— the rare auspicious Saturday on the 5th of lunar month 5 (the strongest auspicious day for consecrating amulets). isWanPhraBuddhist-sabbath detection by the conventional civil lunar reckoning (waxing 8 & 15, waning 8, and the last day of the lunar month), both as a top-level function and as a computedThaiLunarDate.isWanPhragetter.- Lossless round-tripping:
thaiLunarToGregorian(gregorianToThaiLunar(d)) == dfor every day, with the month-5/6 year-end wrap disambiguated viaThaiLunarDate.isYearEndWrap. ThaiLunarDateisComparable(chronological) and exposescopyWith,weekdayandcsYear.- Era-aware API (
ThaiEra, BE / CE) withbeToCe/ceToBehelpers. - Integer-only arithmetic; validated against the JDN anchor 2000-01-01 (horakhun 497378, julian day 2451545).