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

@gambhirpoudel/nepali-calendar-kit

v2.0.0

Published

Premium themeable Nepali DatePicker and AD/BS Converter for React.

Readme

Nepali Calendar Kit

A lightweight React library for Nepali calendar operations, including AD ↔ BS conversion, date formatting, and a Nepali Date Picker component.

Package: @gambhirpoudel/nepali-calendar-kit

npm install @gambhirpoudel/nepali-calendar-kit

Features

  • Convert AD (Gregorian) dates to BS (Bikram Sambat) and vice versa.
  • Editable NepaliDatePicker — type dates in BS or AD, auto-detected and converted.
  • Multiple display formats (YYYY-MM-DD, DD-MM-YYYY, DD/MM/YYYY, YYYY/MM/DD).
  • Nepali numeral support (१, २, ३…) via single calLan toggle.
  • Fully themeable — every visual element customizable via Theme.
  • Keyboard-friendly — Enter to confirm, Escape to dismiss.
  • Fully TypeScript typed.

Live Demo

Try the interactive playground in your browser:

Chrome


1. Date Conversion

import {
  adToBs,
  bsToAd,
  formatBs,
  formatAd,
} from "@gambhirpoudel/nepali-calendar-kit";

// Convert AD → BS
const bsDate = adToBs(new Date("2026-01-15"));
// { year: 2082, month: 10, day: 1 }

// Convert BS → AD
const adDate = bsToAd(2082, 10, 1);
// Thu Jan 15 2026 00:00:00 GMT+0000 (UTC)

// Format BS Date (Nepali numerals, month name, weekday name)
formatBs(bsDate, "DD-MM-YYYY", "long", "short");
// "१-१०-२०८२"

// Format AD Date (English digits)
formatAd(adDate, "YYYY/MM/DD");
// "2026/01/15"

formatBs

formatBs(date, format?, monthFormat?, dayFormat?)

| Param | Type | Default | Description | |-------------|------------------------------|-------------|-----------------------------------------------| | date | BSDate | — | The BS date to format | | format | DateFormat | YYYY-MM-DD| Structural arrangement of Y, M, D | | monthFormat| FormatPart | "numeric" | Month: "numeric" (१२), "short" (पु), "long" (पुष) | | dayFormat | FormatPart | "numeric" | Day: "numeric" (१), "short" (सोम), "long" (सोमबार) |

All numeric output uses Nepali numerals.


2. Nepali Date Picker

import { NepaliDatePicker } from "@gambhirpoudel/nepali-calendar-kit";

export const MyComponent = () => {
  const handleChange = (result) => {
    console.log("BS:", result.bs);      // "2082-10-01"
    console.log("AD:", result.ad);       // Date object
    console.log("Nepali:", result.nepali); // "२०८२-१०-०१"
  };

  return (
    <NepaliDatePicker
      onChange={handleChange}
      value="2082-10-01"
      format="YYYY-MM-DD"
      calLan="en"
      theme={{
        primary: "#6366f1",
        surfaceBg: "#ffffff",
        inputBg: "#ffffff",
        text: "#0f172a",
        border: "#e2e8f0",
        radius: "12px",
      }}
    />
  );
};

Props

| Prop | Type | Default | Description | |---------------|----------------------------------------------|----------------|------------------------------------------------| | onChange | (result: DatePickerResult \| null) => void | undefined | Callback with BS, AD, and Nepali numeral date | | value | string | "" | Initial BS date ("2082-10-01" or "2082-10") | | format | DateFormat | "YYYY-MM-DD" | Display and input format | | calLan | "en" \| "np" | "en" | Language for all calendar labels | | placeholder | string | format-based | Input placeholder text | | disabled | boolean | false | Disable the picker | | className | string | undefined | Additional CSS class on wrapper | | theme | Theme | undefined | Visual customization (see below) |

Result object

interface DatePickerResult {
  bs: string;     // "2082-10-01"
  ad: Date;       // equivalent AD Date
  nepali: string; // "२०८२-१०-०१"
}

Input behavior

  • Type a BS date (year ≥ 2000) — accepted as-is.
  • Type an AD date (year < 2000) — auto-converted to BS internally.
  • Press Enter — commit the typed date.
  • Press Escape — revert to last valid date and close.
  • Click a day in the calendar — selects that BS date.
  • Supports Nepali numerals in input (e.g. २०८२-१०-०१).

Theme

Every visual aspect is customizable via the theme prop.

interface Theme {
  primary?: string;     // Accent color — active selections, focus rings, buttons
  hoverBg?: string;     // Tint for hover, selected, and highlighted states
  surfaceBg?: string;   // Popover panel and dropdown menu background
  inputBg?: string;     // Input field background
  text?: string;        // Default text color
  border?: string;      // Border color for input, popover, and selects
  radius?: string;      // Outer border radius for input and popover
  fontFamily?: string;  // Font family
  shadow?: string;      // Popover dropdown box shadow
}

Example dark theme:

<NepaliDatePicker
  theme={{
    primary: "#818cf8",
    hoverBg: "#1e1b4b",
    surfaceBg: "#0f172a",
    inputBg: "#0f172a",
    text: "#f1f5f9",
    border: "#1e293b",
    radius: "12px",
    fontFamily: "'Inter', sans-serif",
    shadow: "0 20px 50px -12px rgba(0, 0, 0, 0.5)",
  }}
/>

3. NepaliDate (Date-like API)

Object-oriented wrapper for BS dates.

import { NepaliDate } from "@gambhirpoudel/nepali-calendar-kit";

// Today
const today = NepaliDate.today();
console.log(today.getYear(), today.getMonth(), today.getDate());

// From AD
const fromAd = new NepaliDate(new Date("2026-01-15"));

// From BS
const fromBs = new NepaliDate({ year: 2082, month: 10, day: 1 });

// Format (all Nepali numerals/names)
today.format();                            // "२०८२-१०-०१"
today.format("DD/MM/YYYY", "long", "short"); // "०१/माघ/२०८२"

// Convert back
const ad = today.toAD();
const bs = today.toBS();

Methods

| Method | Description | |----------------------|----------------------------------------| | NepaliDate.today() | Today's Nepali (BS) date | | getYear() | BS year | | getMonth() | BS month (1–12) | | getDate() | BS day | | getDay() | Weekday (0=Sunday, 6=Saturday) | | format(format?, monthFormat?, dayFormat?) | Format BS date | | toAD() | Convert BS → AD | | toBS() | Return raw BS object |

FormatPart

type FormatPart = "numeric" | "short" | "long";

| Value | Month example | Day example | |-------------|---------------|----------------| | "numeric" | १० | १ | | "short" | पुष | सोम | | "long" | पुष | सोमबार |


Supported Date Formats

  • YYYY-MM-DD (default)
  • DD-MM-YYYY
  • DD/MM/YYYY
  • YYYY/MM/DD

License

MIT © Gambhir Poudel