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

v1.0.8

Published

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

Downloads

29

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.

  • Format dates in multiple formats (YYYY-MM-DD, DD-MM-YYYY, DD/MM/YYYY, etc.).

  • Display Nepali dates with:

    • Numeric, short, or long month names
    • Numeric, short, or long weekday names
    • Nepali numerals (१, २, ३…)
  • React NepaliDatePicker component with theming and localization support.

  • Fully TypeScript typed.


Live Demo

Try the Nepali Date Picker and conversion functions directly in your browser:

Click the link to open a live demo with interactive examples.


1. Date Conversion

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

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

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

// Format BS Date
console.log(formatBs(bsDate, "DD-MM-YYYY", "long", "short"));
// Output: "१-१०-२०८२"

// Format AD Date
console.log(formatAd(adDate, "YYYY/MM/DD"));
// Output: "2026/01/15"

2. Nepali Date Picker

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

export const MyComponent = () => {
  const handleChange = (result: any | null) => {
    console.log("Selected Date:", result);
  };

  return (
    <div style={{ padding: "20px" }}>
      <h2>Select a Nepali Date</h2>
      <NepaliDatePicker
        onChange={handleChange}
        theme={{
          primary: "#2563eb",
          primaryLight: "#eff6ff",
          radius: "12px",
          fontFamily: "'Inter', system-ui, sans-serif",
          shadow: "0 10px 25px -5px rgba(0, 0, 0, 0.1)",
          inputBg: "#ffffff",
        }}
        value="2082-10"
        dateLan="en"
        monthLan="en"
        dayLan="en"
        yearLan="en"
      />
    </div>
  );
};

Props

| Prop | Type | Default | Description | | ---------- | -------------------------------------------- | ----------- | -------------------------------- | | onChange | (result: DatePickerResult \| null) => void | undefined | Callback when a date is selected | | theme | Theme | undefined | Custom theming options | | value | string | "" | Initial date value | | dateLan | LanguageCode | "en" | Language for date numbers | | monthLan | LanguageCode | "en" | Language for month names | | dayLan | LanguageCode | "en" | Language for day names | | yearLan | LanguageCode | "en" | Language for year numbers |


Theme Options

interface Theme {
  primary?: string; // Primary color
  primaryLight?: string; // Light primary color
  radius?: string; // Border radius
  fontFamily?: string; // Font family
  shadow?: string; // Box shadow
  inputBg?: string; // Input background color
}

Your README is already well-written and accurate. To add the latest NepaliDate / nepaliToday capability, you only need to add one new section. Everything else should remain exactly the same, as you requested.

Below is the drop-in addition you can paste into your README.


3. NepaliDate (Date-like API)

The library also provides a Date-like wrapper for working with Nepali (BS) dates in a familiar, object-oriented way.

Get today’s Nepali date

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

const today = NepaliDate.today();

console.log(today.getYear());  // 2082
console.log(today.getMonth()); // 10
console.log(today.getDate());  // 1

Create from AD or BS date

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

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

Format Nepali date

today.format();
// "२०८२-१०-०१"

today.format("DD/MM/YYYY", "long", "short");
// "०१/माघ/२०८२"

Convert back to AD

const adDate = today.toAD();
console.log(adDate);
// Thu Jan 15 2026 00:00:00 GMT+0000 (UTC)

Available Methods

| Method | Description | | -------------------- | -------------------------------------- | | NepaliDate.today() | Returns today’s Nepali (BS) date | | getYear() | Returns BS year | | getMonth() | Returns BS month (1–12) | | getDate() | Returns BS day | | getDay() | Returns weekday (0–6, Sunday–Saturday) | | format() | Formats BS date | | toAD() | Converts BS → AD | | toBS() | Returns raw BS object |


Supported Date Formats

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

Example Output

adToBs(new Date("2026-01-15"));
// { year: 2082, month: 10, day: 1 }

formatBs({ year: 2082, month: 10, day: 1 }, "DD-MM-YYYY", "long", "numeric");
// "१-१०-२०८२"

License

MIT © Gambhir Poudel