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

bs-date-picker-react

v1.2.4

Published

A customizable Nepali date picker for React supporting English and Nepali languages.

Readme

BSDatePicker - Nepali & Gregorian Date Picker

Overview

The BSDatePicker is a robust and user-friendly date picker component supporting both the Nepali (Bikram Sambat) and Gregorian (AD) calendar systems. It offers seamless integration for developers looking to implement dual-language date selection in their applications.

Features

  • Dual Calendar Support:
    Switch effortlessly between Nepali (BS) and Gregorian (AD) calendars.

  • Customizable Date Formats:
    Supports popular formats such as YYYY/MM/DD, DD/MM/YYYY, MMMM DD, YYYY and other.

  • Dynamic Calendar Display:

    • Automatic adjustments for months and years across both calendars.
    • Cross-calendar date mapping with highlighted selections.
  • Internationalization:

    • Nepali numerals for BS dates.
    • English numerals for Gregorian dates.
  • Interactive UI:

    • Modern popover-based date picker interface.
    • Responsive design with easy navigation.
  • Callback Integration:
    Provides selected dates in both calendar formats using an onDateChange callback.


Installation

Install the package using npm:

npm install bs-date-picker-react

or

yarn add bs-date-picker-react

Usage

Import and implement the BSDatePicker in your project:

Basic Example

import "bs-date-picker-react/dist/style.css";
import { BSDatePicker } from "bs-date-picker-react";

<BSDatePicker
  language="np"
  format="YYYY-MM-DD"
  onDateChange={(date) => console.log(date)}
/>;

Props

| Prop | Type | Default | Description | | -------------- | -------- | -------------- | -------------------------------------------------------------- | | onDateChange | Function | undefined | Callback providing the selected date in both formats. | | defaultValue | String | undefined | Initial date value (BS or Gregorian format). | | language | String | 'en' | Language for the calendar (np for Nepali, en for English). | | format | String | 'YYYY-MM-DD' | Date format. |


Development Notes

Dependencies

  • nepali-date-converter: Used to handle date conversions between Nepali and Gregorian calendars.
  • @radix-ui/react-popover: Manages the popover dropdown for the calendar UI.
  • lucide-react: Provides the calendar icon.

Style and Responsiveness

  • The component uses a responsive and accessible design.
  • Styling is implemented with utility classes (e.g., Tailwind CSS). Ensure the proper setup of Tailwind or adapt the styles for your project.

Localization

  • Customize day and month names through the MONTH_NAMES and DAY_NAMES constants.
  • Use toNepaliNumeral Convert numbers to Nepali numerals when necessary.

Known Limitations

  • Events like key navigation for accessibility are not implemented but can be added in future versions.

Release Notes

Version 1.1.0

  • Initial release of the BSDatePicker component.
  • Fully functional support for Nepali and Gregorian calendars.
  • Cross-calendar dynamic month/year navigation.
  • Customizable date formats and styling.
  • Input validation and date range checks.

Version 1.1.1

  • Minor Bug fixes

Version 1.1.2

  • Enhance BSDatePicker styling and positioning for better usability
  • Padding bug fix for popover contents

Version 1.1.3/1.1.4

  • Date number css alignment fixes

Version 1.1.5

  • Dynamic background respect to theme

Roadmap

  • Range Selection: Add support for selecting date ranges.
  • Accessibility Improvements: Enhanced support for screen readers.
  • Custom Themes: Provide more options for UI customization.

Contribution

We welcome contributions! If you'd like to improve the component, please follow these steps:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/new-feature).
  3. Commit your changes (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature/new-feature).
  5. Open a pull request.

Support

If you encounter any issues or have suggestions, please reach out to us:

Thank you for choosing BSDatePicker! 🎉

Let me know if you'd like further edits or additions!


License

This component is licensed under the GPL-3.0 License. See the LICENSE file for details.