The Nepali
Date Picker
A headless, framework-agnostic Bikram Sambat date picker with a rich manipulation API, range selection, and optional Material Design styles. BS 2000–2100.
npm install @codersuraz/nepali-datepicker
Everything you need for Nepali dates
A complete toolkit — from low-level date arithmetic to a beautiful, ready-to-use picker UI.
Headless Architecture
Pure state machine with zero DOM assumptions. Drop into React, Vue, Svelte, or Vanilla JS with zero friction.
BS 2000–2100
Complete, accurate Bikram Sambat calendar data for 101 years, with bidirectional AD conversion.
Immutable API
Moment.js-inspired NepaliDate class with chainable arithmetic, comparison, and formatting — all immutable.
Range Picker
Built-in range selection with hover preview, min/max range constraints, and dual-phase click flow.
Multi-Framework
First-class adapters for React hooks, Vue 3 composables, Svelte stores, and Vanilla JS — all tree-shakeable.
Material Design
Optional, beautiful Material-inspired stylesheet with CSS custom properties, ripples, and smooth animations.
Try it right here
An interactive date picker powered by the library. Toggle between English and Nepali locale.
Single Date Picker
Click any date cell to select it. Navigate months and years using the arrow buttons. The picker supports min/max date constraints, disabled days, and locale switching.
import { createPicker, NepaliDate } from 'nepali-datepicker';
import 'nepali-datepicker/dist/material.css';
const picker = createPicker(
document.getElementById('my-picker'), {
locale: 'en',
defaultDate: NepaliDate.today(),
onChange: (date) =>
console.log(date.format('YYYY MMMM DD')),
});
Up and running in seconds
1. Install
npm install nepali-datepicker
2. Import & Use
import { NepaliDate } from 'nepali-datepicker';
const today = NepaliDate.today();
console.log(today.format('MMMM DD, YYYY', 'np'));
// → फाल्गुण २७, २०८२
const next = today.addMonths(3).startOf('month');
console.log(next.format()); // YYYY-MM-DD
3. Core API
// Arithmetic
date.addDays(10).subtractMonths(1);
date.startOf('month');
date.endOf('year');
// Comparison
date.isBefore(other);
date.isBetween(a, b, '[]');
date.diff(other, 'day');
// Conversion
date.toAD(); // → JS Date
NepaliDate.fromAD(new Date());
adToBS(2025, 3, 11);
bsToAD(2081, 11, 27);