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-bs-date-picker

v2.2.0

Published

Nepali date picker and Nepali date range picker — vanilla JS, zero dependencies, Bikram Sambat (BS) ↔ AD conversion, 2082–2100 calendar data, drop-in <script> tag for plain HTML, WordPress, React, Vue.

Readme

Nepali Date Picker & Range Picker

A vanilla JavaScript Nepali (Bikram Sambat) date picker and Nepali date range picker for any website. Zero runtime dependencies. Drops into plain HTML, WordPress, React, Vue, or any framework via a single <script> tag.

  • BS ↔ AD conversion you can trust — uses manually verified calendar data (every existing JS lib derives month lengths algorithmically, which is incorrect because Bikram Sambat months are astronomically determined and published yearly).
  • 2082 – 2100 calendar data ship in the bundle.
  • Popover datepicker, inline calendar, and range / availability / itinerary mode.
  • Light + Dark themes, full keyboard navigation, ARIA roles, English + Nepali numerals.
  • Three bundles — load only what you use.
nepali-date-picker.all.min.js          10.82 KB gz   popover + inline + range
nepali-date-picker.min.js               8.25 KB gz   popover only
nepali-date-range-picker.min.js         6.79 KB gz   inline + range only

Install

CDN / script tag

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nepali-bs-date-picker/dist/nepali-date-picker.min.css">
<script src="https://cdn.jsdelivr.net/npm/nepali-bs-date-picker/dist/nepali-date-picker.all.min.js"></script>

Pick the bundle that matches your use case:

| File | When to use | |---|---| | nepali-date-picker.all.min.js | You need both the popover and the inline / range picker. | | nepali-date-picker.min.js | You only need the popover datepicker on <input> fields. | | nepali-date-range-picker.min.js | You only need the inline calendar (with optional range / itinerary mode). |

npm

npm install nepali-bs-date-picker
import { NepaliDatePicker, NepaliDate, InlineCalendar } from 'nepali-bs-date-picker';
import 'nepali-bs-date-picker/css';
// optional: import 'nepali-bs-date-picker/dark';

Quick start

Popover datepicker

<input type="text" id="dob" placeholder="YYYY-MM-DD">
<script>
  NepaliDatePicker.attach('#dob', {
    language: 'np',
    onChange: (date) => {
      console.log(date.format('YYYY-MM-DD'));   // BS string
      console.log(date.toAD().toISOString());   // native AD Date
    },
  });
</script>

Inline calendar — single or dual month

<div id="cal"></div>
<script>
  NepaliDatePicker.attachInline('#cal', {
    months: 2,
    showAdDate: true,
    onChange: (date) => console.log(date?.format('YYYY-MM-DD')),
  });
</script>

Range / availability calendar (e.g. 7-day trek itinerary)

<div id="cal-range"></div>
<script>
  const cal = NepaliDatePicker.attachInline('#cal-range', {
    months: 2,
    selectionMode: 'range',
    rangeLength: 7,                 // auto-select 7 consecutive days
    onRangeChange: (start, end) => {
      // start and end are NepaliDate instances
      console.log(start.format('YYYY-MM-DD'), '→', end.format('YYYY-MM-DD'));
      // For your API:
      const payload = {
        bs_start: start.format('YYYY-MM-DD'),
        bs_end:   end.format('YYYY-MM-DD'),
        ad_start: start.toAD().toISOString().split('T')[0],
        ad_end:   end.toAD().toISOString().split('T')[0],
        nights:   Math.abs(start.diff(end, 'day')),
      };
    },
  });

  // Free range (click start, then click end):
  cal.setOptions({ rangeLength: null });

  // Set range programmatically:
  const today = NepaliDate.today();
  cal.setRange(today, today.add(6, 'day'));
</script>

API surface

NepaliDatePicker

| Method | Bundles | Description | |---|---|---| | attach(target, options?) | all, picker | Attach popover picker to one or more inputs. | | attachInline(container, options?) | all, range | Mount inline calendar inside an element. | | detach(target) | all, picker | Detach pickers and clean up listeners. | | getInstance(el) | all, picker | Return the Picker instance for an element. | | setDefaults(options) | all, picker | Set global defaults for future attach() calls. | | NepaliDate | all | The NepaliDate class. | | bsToAd, adToBs | all | Primitive conversion functions. |

NepaliDate instance

date.getYear() / getMonth() / getDate() / getDay()
date.format('YYYY-MM-DD' | 'MMMM DD, YYYY' | …, language?)
date.toAD()              // → native JS Date
date.add(n, 'day')       // → new NepaliDate
date.diff(other, 'day')  // → number
date.isBefore(other) / isAfter(other) / isSame(other)
NepaliDate.today() / NepaliDate.parse(str, format)

SEO

This is a Nepali date picker library, a Nepali date range picker library, and a Bikram Sambat date picker for the 2026 / BS 2082+ era. It handles BS to AD conversion, AD to BS conversion, and ships calendar data through BS 2100. Works in WordPress, vanilla HTML, React, Vue, and any modern framework.


License

MIT — © Arjun Jhukal