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

@mohamed_irfan/lanka-calendar

v1.0.4

Published

Sri Lankan holiday and calendar utility package with Poya days, public holidays, bank holidays, and business day calculations.

Readme

@mohamed_irfan/lanka-calendar

A comprehensive Sri Lankan holiday and calendar utility for Node.js and JavaScript applications.

npm version license ES Module


Overview

@mohamed_irfan/lanka-calendar provides accurate, up-to-date Sri Lankan public holiday data with utilities for holiday detection, business day calculations, and calendar generation. Holiday data is sourced from official Sri Lankan government and Central Bank publications and covers 2019 through 2026.


Installation

npm install @mohamed_irfan/lanka-calendar

Features

| Feature | Description | |---|---| | Holiday detection | Public, bank, and mercantile holidays | | Poya days | Full moon Poya day detection | | Business day checks | Accounts for weekends and all holiday types | | Weekend detection | Saturday and Sunday checks | | Calendar generation | Monthly and yearly calendar objects | | Multi-holiday support | Multiple holidays on the same date | | Holiday metadata | Category, religion, status, source, and localized names | | Fast lookups | JSON-based data for minimal overhead | | ES Module support | Works with modern import/export syntax |


Import

import {
  getHolidays,
  getHolidaysByDate,
  getHolidayInfo,
  isHoliday,
  isWeekend,
  isBusinessDay,
  isPublicHoliday,
  isBankHoliday,
  isMercantileHoliday,
  isPoyaDay,
  createCalendarMonth,
  createCalendarYear,
} from "@mohamed_irfan/lanka-calendar";

API Reference

getHolidays(year)

Returns all holidays for a given year.

const holidays = getHolidays(2025);

getHolidaysByDate(date)

Returns all holidays on a specific date. Supports multiple holidays on the same date.

const holidays = getHolidaysByDate("2025-05-12");

getHolidayInfo(date)

Returns metadata for the first holiday found on a given date.

const info = getHolidayInfo("2025-05-12");

isHoliday(date)

Returns true if the given date is any type of holiday.

isHoliday("2025-05-12"); // true

isWeekend(date)

Returns true if the given date falls on a Saturday or Sunday.

isWeekend("2025-05-10"); // true

isBusinessDay(date)

Returns true if the given date is neither a weekend nor a holiday.

isBusinessDay("2025-05-12"); // false

isPublicHoliday(date)

Returns true if the given date is a declared public holiday.

isPublicHoliday("2025-02-04"); // true

isBankHoliday(date)

Returns true if the given date is a bank holiday.

isBankHoliday("2025-02-04"); // true

isMercantileHoliday(date)

Returns true if the given date is a mercantile holiday.

isMercantileHoliday("2025-02-04"); // true

isPoyaDay(date)

Returns true if the given date is a full moon Poya day.

isPoyaDay("2025-05-12"); // true

createCalendarMonth(year, month)

Generates a calendar array for the given month, where each element is a Calendar Day object.

const may2025 = createCalendarMonth(2025, 5);

createCalendarYear(year)

Generates a full calendar for the given year, organized by month.

const calendar2025 = createCalendarYear(2025);

Data Structures

Calendar Day Object

Each day in a generated calendar is represented as:

{
  date: "2025-05-12",
  year: 2025,
  month: 5,
  day: 12,
  dayName: "Monday",

  isToday: false,
  isWeekend: false,

  isHoliday: true,
  isPublicHoliday: true,
  isBankHoliday: true,
  isMercantileHoliday: true,
  isPoyaDay: true,

  isBusinessDay: false,

  holidays: [...],  // Array of Holiday objects
  holiday: {...}    // First Holiday object (convenience accessor)
}

Holiday Object

{
  id: "2025-vesak-full-moon-poya-day",
  name: "Vesak Full Moon Poya Day",

  date: "2025-05-12",
  year: 2025,
  month: 5,
  day: 12,
  day_name: "Monday",

  type: ["Bank", "Public", "Mercantile"],

  category: "religious",
  religion: "Buddhism",

  is_poya: true,
  is_public_holiday: true,
  is_bank_holiday: true,
  is_mercantile_holiday: true,

  status: "confirmed",
  is_tentative: false,
  may_change: false,

  names: {
    en: "Vesak Full Moon Poya Day",
    si: null,
    ta: null
  },

  source: {
    name: "Central Bank of Sri Lanka",
    url: "https://www.cbsl.gov.lk"
  },

  last_updated: "2026-05-21"
}

Supported Years

Holiday data is available for the following years:

2019 · 2020 · 2021 · 2022 · 2023 · 2024 · 2025 · 2026

Support for additional years will be added in future releases.


Data Source

Holiday data is derived from official Sri Lankan government publications and the Central Bank of Sri Lanka.

Primary source: https://www.cbsl.gov.lk


Notes

  • Some Islamic holidays may vary by up to a day depending on moon sighting confirmation.
  • Dates for future years are based on official announcements and may be subject to change.
  • Multiple holidays on the same date are fully supported; use getHolidaysByDate() to retrieve all.

License

MIT © Mohamed Irfan


Author

Mohamed Irfan