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

nepali-heroui-calendar

v1.1.0

Published

Nepali (Bikram Sambat) calendar adapter for @internationalized/date and HeroUI Calendar

Readme

nepali-heroui-calendar

A custom Bikram Sambat (BS) calendar adapter for @internationalized/date and HeroUI / React Aria <Calendar> components.

Instead of re-implementing date maths from scratch, this package bridges Adobe's calendar primitives with the battle-tested lookup tables in nepali-date-converter.

Heads-up: Because the converter is table-driven, the supported range is 2000–2090 BS (≈ 1943 Apr – 2034 Apr AD). Dates outside this range will throw.


Installation

npm install nepali-heroui-calendar

Peer dependencies (your project should already have them if you use HeroUI):

npm install react react-dom @heroui/react @internationalized/date

Usage

1. Drop-in HeroUI Calendar

import { NepaliCalendar, todayNepali } from "nepali-heroui-calendar";

export default function App() {
  return (
    <NepaliCalendar
      aria-label="Nepali Date"
      defaultValue={todayNepali()}
    />
  );
}

2. Use the adapter directly with @internationalized/date

import { CalendarDate, toCalendar, today, getLocalTimeZone } from "@internationalized/date";
import { NepaliCalendarAdapter } from "nepali-heroui-calendar";

const nepali = new NepaliCalendarAdapter();

// Create a BS date
const bsDate = new CalendarDate(nepali, "BS", 2081, 5, 15);

// Convert gregorian "today" to BS
const gToday = today(getLocalTimeZone());
const bsToday = toCalendar(gToday, nepali);

console.log(bsToday.toString()); // 2081-05-15

3. Lower-level helpers

import {
  createCalendarDate,
  toNepaliDate,
  formatDate,
  toNepaliNumerals,
  NEPALI_MONTHS,
} from "nepali-heroui-calendar";

const d = createCalendarDate(2081, 1, 15);

// format with nepali-date-converter patterns
formatDate(d, "ddd DD, MMMM YYYY"); // "Saturday 15, Baisakh 2081"

// convert to a NepaliDate instance (from nepali-date-converter)
const nd = toNepaliDate(d);
nd.format("YYYY/MM/DD", "np"); // "२०८१/०१/१५"

toNepaliNumerals(2081); // "२०८१"

API

NepaliCalendarAdapter (class)

Implements the Calendar interface from @internationalized/date.

| Method | Description | | ------------------- | ----------------------------------------------------- | | fromJulianDay(jd) | JD → BS CalendarDate | | toJulianDay(date) | BS AnyCalendarDate → JD | | getDaysInMonth(d) | Days in that BS month (looked up from converter) | | getMonthsInYear() | Always 12 | | getYearsInEra() | 2090 (last supported year) | | getEras() | ["BS"] |

NepaliCalendar (React component)

A thin wrapper around HeroUI's <Calendar> that pre-binds the Nepali adapter. Accepts all CalendarProps except calendar.

Helpers

| Helper | Return type | Description | | ------------------ | ----------- | ---------------------------------- | | todayNepali() | CalendarDate | Today's date in BS | | createCalendarDate(y,m,d) | CalendarDate | BS CalendarDate factory | | toNepaliDate(d) | NepaliDate | Convert to converter instance | | formatDate(d,fmt)| string | Format via converter | | toNepaliNumerals()| string | 0–9 → Nepali digits |


Limitations & Caveats

  1. Supported range: 2000–2090 BS. The adapter throws outside this range.
  2. No CLDR identifier: "nepali" is not a standard CalendarIdentifier, so createCalendar("nepali") won't work. Always instantiate the class directly: new NepaliCalendarAdapter().
  3. Heading text: HeroUI's <CalendarHeading> currently renders in the active locale using @internationalized/date's DateFormatter, which does not know Nepali month names. If you need Nepali month labels in the header you can compose your own heading with the useNepaliMonthLabels() hook.

License

MIT