Convert Gregorian dates to Myanmar calendar with Thingyan, Watat years, and Buddhist Era. Zero dependencies. Lightning fast with LRU caching. Production-ready.
A complete Myanmar calendar solution built with modern TypeScript and zero dependencies
No external packages. Smaller bundle size. Faster installs. Less security risk. Just pure TypeScript.
Complete type safety with exported types. Better IDE support. Catch errors at compile time.
Complete Thingyan (Water Festival) information including Akyo, Akya, Akyat, Atat, and New Year dates.
Calculate intercalary months and days. Detect leap years and extra days in the Myanmar calendar.
Works everywhere. Separate builds for Node.js and browsers. Use it in any JavaScript environment.
Get Buddhist Era year alongside Myanmar year. Support for traditional calendar systems.
All data available in English and Myanmar script. Month names, weekdays, moon phases in both languages.
Up to 310x faster with LRU caching. O(1) zodiac lookups. Optimized date formatting. 1.8M+ ops/sec on Thingyan calculations.
Maharbote birth signs, Chinese zodiac, Western zodiac, and numerology calculations included.
100% API compatible with v1.x. Drop-in replacement. Upgrade without breaking your code.
Optimized with LRU caching and O(1) lookups for maximum speed
From 5,796 to 1,800,180 ops/sec with intelligent caching of Thingyan calculations.
Nearest watat year lookup now cached. From 14,813 to 702,967 ops/sec.
Access all calendar properties in parallel. From 1,629 to 161,148 ops/sec.
Replaced linear search with constant-time lookup table. 25M+ ops/sec.
Smart cache for watat, thingyan, waso, and firstDayOfTagu calculations. 256-entry LRU per cache.
Replaced expensive toLocaleDateString() with custom formatDate(). Reduced string operations.
Convert any Gregorian date to Myanmar calendar in real-time
Install MyCal with your favorite package manager
npm install mycal
bun add mycal
yarn add mycal
<script type="module">
import { Mycal } from 'https://unpkg.com/mycal@latest/dist/browser/index.js';
const date = new Mycal('2000-01-01');
console.log(date.year); // { en: '1361', my: 'แแแแ' }
</script>
import { Mycal } from 'mycal'; // Myanmar Independence Day const myanmarDate = new Mycal('1/4/1948'); console.log(myanmarDate.year); // { en: '1309', my: 'แแแแ' } console.log(myanmarDate.month); // { en: 'Pyatho', my: 'แแผแฌแแญแฏ' } console.log(myanmarDate.weekday); // { en: 'Sunday', my: 'แแแแบแนแแแฝแฑ' } console.log(myanmarDate.buddhistEraYear); // { en: '2491', my: 'แแแแ' }
All properties are read-only and computed lazily for optimal performance
Full type safety with comprehensive TypeScript definitions
import type { LocalizedString, // { en: string, my: string } ThingyanResult, // Thingyan festival information WatatYearResult, // Watat year information MyanmarDayResult, // Day and moon phase MoonPhase, // 'waxing' | 'full' | 'waning' | 'new' MonthType, // 'hma' | 'hgu' MyanmarMonth, // 0 | 1 | 2 | ... | 12 ChineseZodiacResult,// { sign: string, signInBurmese: string } ZodiacResult, // { sign: string, sign_mm: string } } from 'mycal';