npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

srilanka-calendar

v1.1.0

Published

A comprehensive Sri Lankan calendar library with Poya days, public holidays, Sinhala/Tamil month names, and calendar conversions. Covers 2020–2035.

Downloads

21

Readme

🇱🇰 srilanka-calendar

npm version License: MIT

A comprehensive Sri Lankan calendar library for JavaScript and TypeScript.

Features:

  • 🌕 Poya (Full Moon) days — 2020–2030
  • 🏖️ Public holidays including all national, cultural, and religious events
  • 🔄 Gregorian ↔ Sinhala Buddhist Era conversion
  • 🔤 Sinhala & Tamil month names and weekday translations
  • 📋 Full month/year calendar generation
  • 🎯 Zero dependencies
  • 📦 CommonJS, ES Module, UMD, and TypeScript support

Installation

npm install srilanka-calendar

Usage

CommonJS

const cal = require('srilanka-calendar');

ES Module

import { isPoyaDay, getHolidaysInYear, getDateInfo } from 'srilanka-calendar';

Browser (UMD)

<script src="node_modules/srilanka-calendar/dist/index.umd.js"></script>
<script>
  const info = SriLankaCalendar.getDateInfo('2025-05-12');
</script>

API Reference

🌕 Poya Day Functions

isPoyaDay(date)

Returns true if the given date is a Poya (Full Moon) day.

cal.isPoyaDay('2025-05-12');  // true  (Vesak Poya)
cal.isPoyaDay('2025-05-13');  // false

getPoyaDay(date)

Returns the Poya day info object, or null if not a Poya day.

cal.getPoyaDay('2025-05-12');
// {
//   date: '2025-05-12',
//   name: 'Vesak Poya',
//   sinhala: 'වෙසක් පොහෝ දිනය'
// }

getPoyaDaysInYear(year)

Returns an array of all Poya days in a given year.

cal.getPoyaDaysInYear(2025);
// [ { date: '2025-01-13', name: 'Duruthu Poya', ... }, ... ]

getNextPoyaDay(date?)

Returns the next upcoming Poya day from the given date (defaults to today).

cal.getNextPoyaDay('2025-04-01');
// { date: '2025-04-12', name: 'Bak Poya', ... }

🏖️ Public Holiday Functions

isPublicHoliday(date)

Returns true if the date is a Sri Lankan public holiday (including Poya days).

cal.isPublicHoliday('2025-04-14');  // true  (Sinhala & Tamil New Year)
cal.isPublicHoliday('2025-02-04');  // true  (Independence Day)

getHoliday(date)

Returns the holiday info object, or null.

cal.getHoliday('2025-02-04');
// {
//   date: '2025-02-04',
//   name: 'National Day (Independence Day)',
//   type: 'national',
//   sinhala: 'ජාතික දිනය'
// }

getHolidaysInYear(year)

Returns all public holidays (fixed + Poya) for a given year, sorted by date.

const holidays = cal.getHolidaysInYear(2025);
// 19+ entries including all Poya days and national holidays

getHolidaysInRange(startDate, endDate)

Returns all holidays between two dates (inclusive).

const holidays = cal.getHolidaysInRange('2025-04-01', '2025-05-31');
// [ { date: '2025-04-12', name: 'Bak Poya', ... }, ... ]

🗓️ Calendar Conversion

gregorianToSinhala(date)

Converts a Gregorian date to Sinhala Buddhist Era info.

cal.gregorianToSinhala('2025-06-15');
// {
//   gregorianYear: 2025,
//   gregorianDate: '2025-06-15',
//   buddhistYear: 2568,
//   sinhalYear: 2567,
//   sinhalMonth: { id: 4, sinhala: 'බක්', romanized: 'Bak', english: 'Bak' },
//   era: 'Buddhist Era (BE)'
// }

getCurrentBuddhistYear()

Returns the current Buddhist Era year.

cal.getCurrentBuddhistYear();  // e.g. 2568

🔤 Names & Localization

getSinhalaMonth(monthNumber)

Returns Sinhala month info for a given month number (1–12).

cal.getSinhalaMonth(5);
// { id: 5, sinhala: 'ඇසල', romanized: 'Esala', english: 'Esala' }

getAllSinhalaMonths()

Returns all 12 Sinhala month names.

getTamilMonth(monthNumber)

Returns Tamil month info for a given month number (1–12).

cal.getTamilMonth(4);
// { id: 4, tamil: 'சித்திரை', romanized: 'Chithirai', english: 'April–May' }

getAllTamilMonths()

Returns all 12 Tamil month names.

getWeekdayNames(date)

Returns weekday names in English, Sinhala, and Tamil for a given date.

cal.getWeekdayNames('2025-02-17');  // Monday
// {
//   index: 1,
//   english: 'Monday',
//   sinhala: 'සඳුදා',
//   tamil: 'திங்கட்கிழமை'
// }

getAllWeekdays()

Returns all 7 weekday translations.


📋 Comprehensive Date Info

getDateInfo(date?)

Returns complete Sri Lankan calendar information for a date.

cal.getDateInfo('2025-05-12');
// {
//   gregorian: { date: '2025-05-12', year: 2025, month: 5, day: 12 },
//   sinhala: { buddhistYear: 2568, sinhalYear: 2567, month: {...} },
//   tamil: { month: { tamil: 'வைகாசி', romanized: 'Vaikasi', ... } },
//   weekday: { english: 'Monday', sinhala: 'සඳුදා', tamil: 'திங்கட்கிழமை' },
//   poya: { isPoya: true, name: 'Vesak Poya', sinhala: '...' },
//   holiday: { isHoliday: false },
//   isWorkingDay: false
// }

getMonthCalendar(year, month)

Returns an array of DateInfo objects for each day in a month.

const april = cal.getMonthCalendar(2025, 4);
// Array of 30 DateInfo objects for April 2025

getSinhalaTamilNewYear(year)

Returns Sinhala & Tamil New Year info for a given year.

cal.getSinhalaTamilNewYear(2025);
// {
//   year: 2025,
//   eve: { date: '2025-04-13', name: 'Sinhala & Tamil New Year Eve', ... },
//   newYear: { date: '2025-04-14', name: 'Sinhala & Tamil New Year', ... },
//   buddhistYear: 2568,
//   description: 'Celebrated when the sun transits from Meena Rashiya...'
// }

Raw Data Access

All underlying data is exported for advanced usage:

const { SINHALA_MONTHS, TAMIL_MONTHS, WEEKDAYS, POYA_DAYS } = require('srilanka-calendar');

Holiday Types

| Type | Description | |------|-------------| | national | National public holidays (Independence Day, New Year's Day, etc.) | | cultural | Cultural celebrations (Sinhala & Tamil New Year, etc.) | | religious | Religious observances (Christmas, etc.) | | poya | Monthly Poya (Full Moon) days |


Supported Years

Poya day data covers 2020–2035. Fixed public holidays apply to any year.


TypeScript

Full TypeScript support is included. All functions and data structures are typed.

import { getDateInfo, DateInfo, PoyaDay } from 'srilanka-calendar';

const info: DateInfo = getDateInfo(new Date());
console.log(info.poya.isPoya);

License

MIT © 2026 srilanka-calendar contributors