The Professional
Nepali Calendar Kit
High-performance library for converting between Gregorian (AD) and Nepali (BS) dates. Includes an interactive date picker with full TypeScript support.
AD ↔ BS Conversion
Seamlessly convert between Gregorian and Nepali calendars with verified accuracy.
Interactive DatePicker
React component for selecting Nepali dates with full customization options.
Flexible Formatting
Multiple formatting options with Nepali numerals and localized month names.
Key Features
Based on verified data since 1943
Full type definitions included
Lightweight and fully self-contained core
English and Nepali localized outputs
Core Features
AD to BS & BS to AD
Convert AD (Gregorian) dates to BS (Bikram Sambat) and vice versa with precision.
Multiple Formats
Format dates in YYYY-MM-DD, DD-MM-YYYY, DD/MM/YYYY, and custom configurations.
Localization
Display Nepali dates with numeric, short, or long month names, and Nepali numerals (१, २, ३…).
Nepali DatePicker
React component with powerful theming, accessibility, and localization support built-in.
Fully Typed
First-class TypeScript support for robust development and auto-completion.
1. Getting Started
Install the package and start converting dates in seconds with full type safety.
npm install @gambhirpoudel/nepali-calendar-kitNext Steps
Explore each function below to see interactive demos and examples. All functions are fully typed with TypeScript for the best developer experience.
Quick Example
import{ adToBs, formatBs }from"@gambhirpoudel/nepali-calendar-kit";// Convert AD to BSconstbsDate =adToBs(newDate());// Format the dateconstformatted =formatBs(bsDate,'YYYY-MM-DD');console.log(formatted);// "२०८१-०१-२७"
2. Date Conversion
Seamlessly bridge the gap between Gregorian and Bikram Sambat calendars.
3. Customizable Component
A fully-featured React component with deep customization for any design system.
Component Props
Detailed breakdown of all available configuration options for the NepaliDatePicker.
| Property | 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 (YYYY-MM-DD) |
| format | DateFormat | "YYYY-MM-DD" | Display and input format |
| calLan | LanguageCode | "en" | Language for all calendar labels |
| placeholder | string | undefined | Input placeholder text |
| disabled | boolean | false | Disable the date picker |
| className | string | undefined | Additional CSS class name |
Theme Interface
Deep customization options to perfectly align the component with your application's brand identity.
interface Theme {
primary?: string; // Accent color (HEX/HSL)
hoverBg?: string; // Hover/Active background
surfaceBg?: string; // Popover surface background
inputBg?: string; // Input field background
text?: string; // Text color
border?: string; // Border color
radius?: string; // Border radius (e.g. '12px')
fontFamily?: string; // Custom font-stack
shadow?: string; // Box shadow definition
}The heartbeat of the UI. Applied to selected dates, buttons, and high-impact accents.
Background color for hovered and active calendar cells.
Controls the architectural feel. Use px for precision or rem for responsive scales.
Ensures typographic harmony. Defaults to system-ui but accepts any web font.
NepaliDate API
A first-class, immutable API that mirror's JavaScript's native Date object for the Bikram Sambat calendar.
const today = NepaliDate.today();
today.getYear(); // 2082// From AD
new NepaliDate(new Date("2026-01-15"));
// From BS
new NepaliDate({ year: 2082, month: 10, day: 1 });// Default format (BS)
today.format(); // "२०८२-१०-०१"
// Custom long format
today.format("DD/MM/YYYY", "long", "short");
// "१२/भदौ/२०८२"
Why NepaliDate?
Provides a familiar interface for developers already comfortable with the JS Date API. It handles edge cases like leap months and historical discrepancies automatically.
Date Format Playground
Mix and match date layouts with numeric, short, and long representations for months and days.
Today is
२०८३-२-२७
Year
2083
Month
2
Day
27
formatBs( { year: 2083, month: 2, day: 27 }, 'YYYY-MM-DD', 'numeric', 'numeric', )
// Result: "२०८३-२-२७"
Real-world Examples
See how the library parses and outputs data in different scenarios.
AD to BS Conversion
// Result: { year: 2059, month: 5, day: 1 }
Nepali Numerals
// Result: "१-१०-२०८२"
bs: '2082-10-29',
ad: 'Thu Feb 12 2026',
nepali: '२०८२-१०-२९'
}
The component returns a comprehensive object containing all necessary formats to minimize manual parsing.